swarm listen done

This commit is contained in:
Robert Zajac 2018-11-11 20:41:06 -05:00
parent 86ed5e7e7b
commit 87c3da6c66
2 changed files with 1 additions and 3 deletions

View File

@ -76,7 +76,6 @@ class Swarm(INetwork):
# Have conn handler delegate to stream handler # Have conn handler delegate to stream handler
# Call listener listen with the multiaddr # Call listener listen with the multiaddr
# Map multiaddr to listener # Map multiaddr to listener
for multiaddr_str in args: for multiaddr_str in args:
if multiaddr_str in self.listeners: if multiaddr_str in self.listeners:
return True return True
@ -87,7 +86,7 @@ class Swarm(INetwork):
def conn_handler(reader, writer): def conn_handler(reader, writer):
# Upgrade reader/write to a net_stream and pass to appropriate stream handler (using multiaddr) # Upgrade reader/write to a net_stream and pass to appropriate stream handler (using multiaddr)
raw_conn = RawConnection(multiaddr_dict.host, multiaddr_dict.port, reader, writer) raw_conn = RawConnection(multiaddr_dict.host, multiaddr_dict.port, reader, writer)
muxed_conn = self.upgrader.upgrade_connection(raw_conn) muxed_conn = self.upgrader.upgrade_connection(raw_conn, False)
# TODO: make generic protocols work # TODO: make generic protocols work
muxed_stream, stream_id, protocol_id = muxed_conn.accept_stream() muxed_stream, stream_id, protocol_id = muxed_conn.accept_stream()

View File

@ -24,5 +24,4 @@ class TransportUpgrader(object):
# Default to mplex # Default to mplex
# TODO do exchange to determine multiplexer # TODO do exchange to determine multiplexer
return MuxedConn(conn, initiator) return MuxedConn(conn, initiator)