HVLP is a simple protocol for sending messages between clients and a broker. The protocol is based on the MQTT protocol and is implemented in Python. The main focus of the project is to demonstrate the use of OOP, SOLID principles, sockets and threading in Python.
- Connect to a broker
- Subscribe to a topic
- Publish to a topic
- Disconnect from a broker
- Support for multiple clients
Use a git client to clone the project from https://github.com/braboj/hvlp to a folder of your choice.
Type cd <path to project folder>
Type set PYTHONPATH=.
to add the root folder to the module search paths.
Type python broker.py <IP ADDR> <PORT>
to start the broker. If omitted the default IP is 127.0.0.1 and the default port is 65432.
Type set PYTHONPATH=.
to add the root folder to the module search paths.
Type python client.py <SERVER ADDR> <PORT>
to start the client. If omitted the default server
address is 127.0.0.1 and the default port s 65432.
Type connect
in the client console to connect to the broker
Type subscribe test
in the client console to subscribe to a topic
Type publish test 1 in one of the client consoles.
Type help
in the client console for more commands
Type quit
or press CTRL + C in a client console to exit the client. To exit the broker press
CTRL + C. There might be a slight delay (1-2 seconds) until the application ends.