From 8f16c2e1138388c09004c38c4a4aadccb630b26f Mon Sep 17 00:00:00 2001 From: SantaSpeen Date: Wed, 12 Mar 2025 14:40:04 +0300 Subject: [PATCH] [+] TODOs [+] exmples dir --- README.md | 42 ++++++++++++++++++++++++++++++------------ 1 file changed, 30 insertions(+), 12 deletions(-) diff --git a/README.md b/README.md index 7885747..4ba603b 100644 --- a/README.md +++ b/README.md @@ -1,12 +1,23 @@ # winConnect (Windows Only) Communication Client->Daemon via NamedPipe +## ToDo: + +- [x] Add support for other header settings +- [ ] Add logging +- [x] Add support for safe closing +- [ ] Add support for multiple clients +- [ ] Particular client to client communication +- [ ] Add support for encryption + ## Description This is a simple client-server communication system for Windows. The client and server communicate via a named pipe. The client sends a message to the server, and the server responds with a message. The client and server can be run on the same machine or on different machines. ## Usage +You can find examples in the [examples](examples) directory. + ### Server The server is a daemon that listens for incoming messages from clients. The server can be run on the same machine as the client or on a different machine. To run the server, use the following command: @@ -14,11 +25,12 @@ The server is a daemon that listens for incoming messages from clients. The serv ```python from winConnect import WinConnectDaemon -connector = WinConnectDaemon('test') -connector.set_header_settings(">L", 32) +connector = WinConnectDaemon('test') # test - name of the pipe for data in connector.listen(): - print(data) + print(f"({type(data)}) {data=}") + if data is None and connector.closed: + break connector.send_data(data) ``` @@ -31,19 +43,25 @@ from winConnect import WinConnectClient connector = WinConnectClient('test') -for data in connector.listen(): - print(data) - i = input(":> ") - connector.send_data(i) +with connector as conn: + while True: + i = input(":> ") + if i == "exit": break + conn.send_data(i) + print(conn.read_pipe()) ``` -## Installation +[//]: # (## Installation) -To install the package, use the following command: +[//]: # () +[//]: # (To install the package, use the following command:) -```bash -pip install winConnect -``` +[//]: # () +[//]: # (```bash) + +[//]: # (pip install winConnect) + +[//]: # (```) ## License