mirror of
https://github.com/varun-r-mallya/py-libp2p.git
synced 2026-02-12 16:10:57 +00:00
make stream close async
This commit is contained in:
parent
01daf8ae8a
commit
96edf96e76
@ -83,8 +83,12 @@ class MuxedConn(IMuxedConn):
|
||||
# << by 3, then or with flag
|
||||
header = (stream_id << 3) | flag
|
||||
header = encode_uvarint(header)
|
||||
data_length = encode_uvarint(len(data))
|
||||
_bytes = header + data_length + data
|
||||
if data is None:
|
||||
data_length = encode_uvarint(0)
|
||||
_bytes = header + data_length
|
||||
else:
|
||||
data_length = encode_uvarint(len(data))
|
||||
_bytes = header + data_length + data
|
||||
|
||||
return await self.write_to_stream(_bytes)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user