From d90b280d4149fb4d48ce037bc6291d40ec3b454d Mon Sep 17 00:00:00 2001 From: KKlochko Date: Tue, 12 Dec 2023 18:01:45 +0200 Subject: [PATCH] Add a function to receive a message. --- notification_client/client.py | 11 ++++++++--- notification_client/main.py | 2 +- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/notification_client/client.py b/notification_client/client.py index 22a8196..de86e33 100644 --- a/notification_client/client.py +++ b/notification_client/client.py @@ -32,12 +32,17 @@ class Client: reader, writer = await asyncio.open_connection(self.__ip, self.__port) await self.handle(reader, writer) + @staticmethod + async def receive_message(reader) -> str: + size, = struct.unpack('