From b2a35114b1828dae3545fcfb6b12111c5aa7cb18 Mon Sep 17 00:00:00 2001 From: Robert Zajac Date: Sun, 18 Nov 2018 16:04:52 -0500 Subject: [PATCH] reading logic in muxed_connection --- muxer/mplex/muxed_connection.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/muxer/mplex/muxed_connection.py b/muxer/mplex/muxed_connection.py index 61bd6fe..c2fd343 100644 --- a/muxer/mplex/muxed_connection.py +++ b/muxer/mplex/muxed_connection.py @@ -20,7 +20,10 @@ class MuxedConn(IMuxedConn): self.streams = {} self.stream_queue = asyncio.Queue() - asyncio.ensure_future(self.handle_incoming()) + # The initiator need not read upon construction time. + # It should read when the user decides that it wants to read from the constructed stream. + if not initiator: + asyncio.ensure_future(self.handle_incoming()) def close(self): """