py-libp2p/connection/raw_connection.py
2018-10-31 23:08:47 +01:00

15 lines
398 B
Python

import asyncio
from .raw_connection_interface import IRawConnection
class RawConnection(IRawConnection):
def __init__(self, ip, port):
self.conn_ip = ip
self.conn_port = port
self.reader = None
self.writer = None
async def open_connection(self):
self.reader, self.writer = \
await asyncio.open_connection(self.conn_ip, self.conn_port)