mirror of
https://github.com/varun-r-mallya/py-libp2p.git
synced 2025-12-31 20:36:24 +00:00
move transport to swarm constructor
This commit is contained in:
@ -12,14 +12,14 @@ from .connection.raw_connection import RawConnection
|
||||
class Swarm(INetwork):
|
||||
# pylint: disable=too-many-instance-attributes, cell-var-from-loop
|
||||
|
||||
def __init__(self, peer_id, peerstore, upgrader):
|
||||
def __init__(self, peer_id, peerstore, upgrader, transport):
|
||||
self.self_id = peer_id
|
||||
self.peerstore = peerstore
|
||||
self.upgrader = upgrader
|
||||
self.transport = transport
|
||||
self.connections = dict()
|
||||
self.listeners = dict()
|
||||
self.stream_handlers = dict()
|
||||
self.transport = None
|
||||
|
||||
# Protocol muxing
|
||||
self.multiselect = Multiselect()
|
||||
@ -183,10 +183,6 @@ class Swarm(INetwork):
|
||||
return True
|
||||
return False
|
||||
|
||||
def add_transport(self, transport):
|
||||
# TODO: Support more than one transport
|
||||
self.transport = transport
|
||||
|
||||
def create_generic_protocol_handler(swarm):
|
||||
"""
|
||||
Create a generic protocol handler from the given swarm. We use swarm
|
||||
|
||||
Reference in New Issue
Block a user