Metadata-Version: 2.1
Name: simpleprotocol
Version: 1.0.1
Summary: A package for using a basic protocol socket
Home-page: https://github.com/Chinbob2515/python-simpleprotocol
Author: Ben Hack
Author-email: benjamin.hack@balliol.ox.ac.uk
License: UNKNOWN
Platform: UNKNOWN
Classifier: Programming Language :: Python :: 3
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Requires-Python: >=3.6
Description-Content-Type: text/markdown

# 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..."])

```


