kopia lustrzana https://github.com/micropython/micropython-lib
uasyncio: Add checks that IOWrite() syscall return us socket we expect.
One check is commented by default to not hurt performance.pull/11/head
rodzic
89f3b75b72
commit
2a26ee80b7
|
@ -125,7 +125,8 @@ class StreamWriter:
|
|||
assert res < sz
|
||||
buf = buf[res:]
|
||||
sz -= res
|
||||
s = yield IOWrite(self.s)
|
||||
s2 = yield IOWrite(self.s)
|
||||
#assert s2.fileno() == self.s.fileno()
|
||||
if __debug__:
|
||||
log.debug("StreamWriter.awrite(): can write more")
|
||||
|
||||
|
@ -151,7 +152,9 @@ def open_connection(host, port):
|
|||
raise
|
||||
if __debug__:
|
||||
log.debug("open_connection: After connect")
|
||||
s = yield IOWrite(s)
|
||||
s2 = yield IOWrite(s)
|
||||
if __debug__:
|
||||
assert s2.fileno() == s.fileno()
|
||||
if __debug__:
|
||||
log.debug("open_connection: After iowait: %s", s)
|
||||
return StreamReader(s), StreamWriter(s)
|
||||
|
|
Ładowanie…
Reference in New Issue