typed muxed_connection_interface.py

This commit is contained in:
Chih Cheng Liang
2019-08-02 18:03:34 +08:00
parent b64ed9fd6f
commit dadac423f2
2 changed files with 22 additions and 11 deletions

View File

@ -42,7 +42,7 @@ class Mplex(IMuxedConn):
for new muxed streams
:param peer_id: peer_id of peer the connection is to
"""
super(Mplex, self).__init__(secured_conn, generic_protocol_handler, peer_id)
super().__init__(secured_conn, generic_protocol_handler, peer_id)
self.secured_conn = secured_conn
self.raw_conn = secured_conn.get_conn()
@ -111,7 +111,6 @@ class Mplex(IMuxedConn):
async def accept_stream(self) -> None:
"""
accepts a muxed stream opened by the other end
:return: the accepted stream
"""
stream_id = await self.stream_queue.get()
stream = MplexStream(stream_id, False, self)