fixed stream

This commit is contained in:
zixuanzh 2018-10-31 23:13:51 +01:00
parent 2315388589
commit 92867c42a4
2 changed files with 7 additions and 5 deletions

View File

@ -1,5 +1,5 @@
from .stream_interface import IStream
import asyncio import asyncio
from .stream_interface import IStream
class Stream(IStream): class Stream(IStream):
@ -7,12 +7,14 @@ class Stream(IStream):
IStream.__init__(self, peer_id, multi_addr) IStream.__init__(self, peer_id, multi_addr)
self.peer_id = peer_id self.peer_id = peer_id
ip = multi_addr.get_protocol_value("ip4") stream_ip = multi_addr.get_protocol_value("ip4")
port = multi_addr.get_protocol_value("tcp") stream_port = multi_addr.get_protocol_value("tcp")
self.reader = connection.reader self.reader = connection.reader
self.writer = connection.writer self.writer = connection.writer
# TODO should construct protocol id from constructor
self.protocol_id = None
def protocol(self): def get_protocol(self):
""" """
:return: protocol id that stream runs on :return: protocol id that stream runs on
""" """

View File

@ -8,7 +8,7 @@ class IStream(ABC):
self.connection = connection self.connection = connection
@abstractmethod @abstractmethod
def protocol(self): def get_protocol(self):
""" """
:return: protocol id that stream runs on :return: protocol id that stream runs on
""" """