This project implements a topic-based messaging broker using TCP and UDP sockets
.
├── server.c # Core broker logic (TCP/UDP)
├── subscriber.c # TCP client with subscribe/unsubscribe commands
├── udp_client.py # UDP publisher simulator
├── test.py / testtest.py # Python testing utilities
├── mypayloads.json # Custom message sets for testing
├── sample_payloads.json
├── sample_wildcard_payloads.json
├── three_topics_payloads.json
├── utils/ # Utility functions
├── .vscode/ # VSCode config (optional)
├── pcom_hw2_udp_client/ # Provided UDP client (original)
├── Makefile # Build automation for C components
├── server / subscriber # Compiled binaries (gitignored ideally)
├── README.md # You're reading it!
└── readme.txt # Original assignment description
makeThis builds server and subscriber. Run make clean to remove binaries.
./server <PORT>./subscriber <ID_CLIENT> <SERVER_IP> <PORT>python3 udp_client.py <SERVER_IP> <PORT> sample_payloads.json- topic: max 50 bytes (null-terminated)
- type: 1 byte (
INT,SHORT_REAL,FLOAT,STRING) - payload: depends on type (see
README.txt)
- Length-prefixed messages (
uint32_theader) - Commands:
subscribe <topic>,unsubscribe <topic>,exit
Use the Python scripts and provided JSON files to simulate message flows and wildcard behavior:
python3 test.py # Custom tests
python3 udp_client.py ... # Raw publish simulation