diff --git a/notification_client/client.py b/notification_client/client.py new file mode 100644 index 0000000..eda0f8c --- /dev/null +++ b/notification_client/client.py @@ -0,0 +1,28 @@ +import asyncio +import struct + + +class Client: + BUFFER_SIZE = 1024 + + def __init__(self, ip: str, port: int): + self.__ip = ip + self.__port = port + + async def connect(self): + reader, writer = await asyncio.open_connection(self.__ip, self.__port) + await self.handle(reader, writer) + + async def handle(self, reader, writer): + try: + while True: + size, = struct.unpack('