Reorganize folders (stream and connection)

This commit is contained in:
Stuckinaboot
2018-11-11 16:09:37 -05:00
parent 356cac02bf
commit 6ba5793c1d
8 changed files with 25 additions and 126 deletions

View File

View File

@ -0,0 +1,22 @@
import asyncio
from .raw_connection_interface import IRawConnection
class RawConnection(IRawConnection):
def __init__(self, ip, port, reader, writer):
self.conn_ip = ip
self.conn_port = port
self.reader = reader
self.writer = writer
# def __init__(self, ip, port):
# self.conn_ip = ip
# self.conn_port = port
# self.reader, self.writer = self.open_connection()
# async def open_connection(self):
# """
# opens a connection on self.ip and self.port
# :return: a raw connection
# """
# return await asyncio.open_connection(self.conn_ip, self.conn_port)

View File

@ -0,0 +1,15 @@
from abc import ABC, abstractmethod
class IRawConnection(ABC):
"""
A Raw Connection provides a Reader and a Writer
open_connection should return such a connection
"""
# @abstractmethod
# async def open_connection(self):
# """
# opens a connection on ip and port
# :return: a raw connection
# """
# pass