Add mplex tests and fix error in SwarmConn.close

This commit is contained in:
mhchia
2019-09-18 15:44:45 +08:00
parent d61327f5f9
commit a9ad37bc6f
14 changed files with 96 additions and 44 deletions

View File

@ -29,9 +29,6 @@ class Mplex(IMuxedConn):
secured_conn: ISecureConn
peer_id: ID
# TODO: `dataIn` in go implementation. Should be size of 8.
# TODO: Also, `dataIn` is closed indicating EOF in Go. We don't have similar strategies
# to let the `MplexStream`s know that EOF arrived (#235).
next_channel_id: int
streams: Dict[StreamID, MplexStream]
streams_lock: asyncio.Lock

View File

@ -24,6 +24,7 @@ class MplexStream(IMuxedStream):
close_lock: asyncio.Lock
# NOTE: `dataIn` is size of 8 in Go implementation.
incoming_data: "asyncio.Queue[bytes]"
event_local_closed: asyncio.Event