summaryrefslogtreecommitdiff
path: root/extmod/uasyncio/stream.py
diff options
context:
space:
mode:
authoroclyke <owen.lyke@sparkfun.com>2021-07-22 17:42:30 -0600
committerDamien George <damien@micropython.org>2021-07-31 15:33:48 +1000
commite29259d171300b9b8de81c736f717ba6de9c8253 (patch)
tree3aa13e0ecac94698e806128bde0ec33b5a41921b /extmod/uasyncio/stream.py
parent40b8ff0a6fd737bdad8e0559994a55b7c2ce0786 (diff)
extmod/uasyncio: In open_connection use address info in socket creation.
Rudimentary support for various address families. Signed-off-by: oclyke <oclyke@gmail.com>
Diffstat (limited to 'extmod/uasyncio/stream.py')
-rw-r--r--extmod/uasyncio/stream.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/extmod/uasyncio/stream.py b/extmod/uasyncio/stream.py
index 8de2d2599..af3b8feab 100644
--- a/extmod/uasyncio/stream.py
+++ b/extmod/uasyncio/stream.py
@@ -79,8 +79,8 @@ async def open_connection(host, port):
from uerrno import EINPROGRESS
import usocket as socket
- ai = socket.getaddrinfo(host, port)[0] # TODO this is blocking!
- s = socket.socket()
+ ai = socket.getaddrinfo(host, port, 0, socket.SOCK_STREAM)[0] # TODO this is blocking!
+ s = socket.socket(ai[0], ai[1], ai[2])
s.setblocking(False)
ss = Stream(s)
try: