A package for using a basic protocol socket
Project description
python-simpleprotocol
A small socket wrapper
Used for sending code, subcode, parameters.
Code: Integer
Subcode: Integer
Params: Array of strings
Only has basic use, as shown in this example:
Server:
import simpleprotocol
server = simpleprotocol.SimpleServer(port=8080)
while True:
handler = server.accept()
handler.send(0)
print(handler.get())
handler = server.accept()
handler.send(1)
print(handler.get())
Client:
import simpleprotocol
socket = simpleprotocol.SimpleProtocol()
if socket.get().code:
socket.send(1, 0, ["That sounds good!"])
else:
socket.send(1, 1, ["Oh dear, that's not right..."])
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
simpleprotocol-1.0.1.tar.gz
(2.9 kB
view hashes)
Built Distribution
Close
Hashes for simpleprotocol-1.0.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6a631990d6fc9a96b3da4fccfb2a54ff1e6970305f415c4996da438db83f450d |
|
MD5 | e5e2069429e406b0516e9fb708b99f78 |
|
BLAKE2b-256 | 87bfe48e248090bc9f5d054ad353e77c80371fc5d0b5b2eb3ea8d73b59293c8d |