mirror of
https://github.com/SantaSpeen/winConnect.git
synced 2026-10-28 07:00:23 +00:00
[+] TODOs
[+] exmples dir
This commit is contained in:
1 parent
ab06266681
commit
8f16c2e113
1 file changed
+29
-11
@@ -1,12 +1,23 @@
|
|||||||
# winConnect (Windows Only)
|
# winConnect (Windows Only)
|
||||||
Communication Client->Daemon via NamedPipe
|
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
|
## 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.
|
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
|
## Usage
|
||||||
|
|
||||||
|
You can find examples in the [examples](examples) directory.
|
||||||
|
|
||||||
### Server
|
### 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:
|
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
|
```python
|
||||||
from winConnect import WinConnectDaemon
|
from winConnect import WinConnectDaemon
|
||||||
|
|
||||||
connector = WinConnectDaemon('test')
|
connector = WinConnectDaemon('test') # test - name of the pipe
|
||||||
connector.set_header_settings(">L", 32)
|
|
||||||
|
|
||||||
for data in connector.listen():
|
for data in connector.listen():
|
||||||
print(data)
|
print(f"({type(data)}) {data=}")
|
||||||
|
if data is None and connector.closed:
|
||||||
|
break
|
||||||
connector.send_data(data)
|
connector.send_data(data)
|
||||||
```
|
```
|
||||||
|
|
||||||
@@ -31,19 +43,25 @@ from winConnect import WinConnectClient
|
|||||||
|
|
||||||
connector = WinConnectClient('test')
|
connector = WinConnectClient('test')
|
||||||
|
|
||||||
for data in connector.listen():
|
with connector as conn:
|
||||||
print(data)
|
while True:
|
||||||
i = input(":> ")
|
i = input(":> ")
|
||||||
connector.send_data(i)
|
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
|
## License
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user