mirror of
https://github.com/SantaSpeen/winConnect.git
synced 2026-04-17 22:09:54 +00:00
[+] add examples
This commit is contained in:
14
examples/echo_server.py
Normal file
14
examples/echo_server.py
Normal file
@@ -0,0 +1,14 @@
|
||||
from winConnect import WinConnectDaemon
|
||||
|
||||
connector = WinConnectDaemon('test')
|
||||
# Set header settings
|
||||
# see: https://docs.python.org/3.13/library/struct.html#format-characters
|
||||
# Default: ">L"
|
||||
# >L - Big-endian long integer (header_size: 4 bytes, max_size: 4294967295)
|
||||
connector.set_header_settings(">L")
|
||||
|
||||
for data in connector.listen():
|
||||
print(f"({type(data)}) {data=}")
|
||||
if data is None and connector.closed:
|
||||
break
|
||||
connector.send_data(data)
|
||||
Reference in New Issue
Block a user