Metadata-Version: 2.2
Name: winConnect
Version: 0.9.1
Summary: Communicate Client-Server via Windows NamedPipe.
Home-page: https://github.com/SantaSpeen/winConnect
Author: SantaSpeen
Author-email: admin@anidev.ru
License: MIT
Project-URL: Source, https://github.com/SantaSpeen/winConnect
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: Natural Language :: Russian
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: Microsoft :: Windows
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: pywin32==309
Requires-Dist: ormsgpack==1.8.0
Dynamic: author
Dynamic: author-email
Dynamic: classifier
Dynamic: description
Dynamic: description-content-type
Dynamic: home-page
Dynamic: license
Dynamic: project-url
Dynamic: requires-dist
Dynamic: requires-python
Dynamic: summary

# winConnect (Windows Only)
Communication Client->Daemon via NamedPipe

## ToDo:

- [x] Add support for sending and receiving data
- [x] Add support for other header settings
- [x] Add support for safe closing
- [x] Add logging
- [ ] Particular client to client communication (via chunks(?))
- [ ] Add support for encryption
- [ ] Add support for multiple clients

## 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:

```python
from winConnect import WinConnectDaemon

connector = WinConnectDaemon('test')  # test - name of the pipe

for data in connector.listen():
    print(f"({type(data)}) {data=}")
    if data is None and connector.closed:
        break
    connector.send_data(data)
```

### Client

The client sends a message to the server and waits for a response. To run the client, use the following command:

```python
from winConnect import WinConnectClient

connector = WinConnectClient('test')

with connector as conn:
    while True:
        i = input(":> ")
        if i == "exit": break
        conn.send_data(i)
        print(conn.read_pipe())
```

[//]: # (## Installation)

[//]: # ()
[//]: # (To install the package, use the following command:)

[//]: # ()
[//]: # (```bash)

[//]: # (pip install winConnect)

[//]: # (```)

## License

This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
