mirror of
https://github.com/SantaSpeen/winConnect.git
synced 2026-04-24 09:16:50 +00:00
rename
This commit is contained in:
13
examples/server_echo.py
Normal file
13
examples/server_echo.py
Normal file
@@ -0,0 +1,13 @@
|
||||
from winConnect import WinConnectDaemon
|
||||
|
||||
connector = WinConnectDaemon('test')
|
||||
# Set header settings
|
||||
# see: https://docs.python.org/3.13/library/struct.html#format-characters
|
||||
# Default: ">H" - Big-endian unsigned short integer (header_size: 2 bytes, max_size: 65535)
|
||||
connector.set_header_settings(">H")
|
||||
|
||||
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