mirror of
https://github.com/varun-r-mallya/py-libp2p.git
synced 2025-12-31 20:36:24 +00:00
Fix Mplex and Swarm
This commit is contained in:
@ -23,6 +23,10 @@ class TrioReadWriteCloser(ReadWriteCloser):
|
||||
raise IOException(error)
|
||||
|
||||
async def read(self, n: int = -1) -> bytes:
|
||||
if n == 0:
|
||||
# Check point
|
||||
await trio.sleep(0)
|
||||
return b""
|
||||
max_bytes = n if n != -1 else None
|
||||
try:
|
||||
return await self.stream.receive_some(max_bytes)
|
||||
|
||||
Reference in New Issue
Block a user