NetProbe is a lightweight C++ networking playground for exploring sockets, multicast, TCP servers/clients, lock-free queues, custom memory pools, and multithreaded programming — all wrapped with a minimal logging and timing utility.
It’s designed to help you understand and experiment with the low-level building blocks behind distributed systems, trading infrastructure, and networked applications.
./
└── src/
├── chat_client.cpp # Simple TCP chat client
├── chat_server.cpp # Broadcast chat server using epoll
├── lf_queue_example.cpp # Lock-free queue producer-consumer demo
├── logging_example.cpp # Logging utility showcase
├── mcast_publisher.cpp # Multicast publisher sending random ticks
├── mcast_socket.cpp # Multicast socket abstraction
├── mcast_subscriber.cpp # Multicast subscriber that prints incoming ticks
├── mem_pool_example.cpp # Memory pool allocator example
├── socket_example.cpp # TCP server-client interaction example
├── tcp_server.cpp # Epoll-based TCP server core
├── tcp_socket.cpp # TCP socket abstraction
└── thread_example.cpp # Thread utility and example
Make sure you have CMake ≥ 3.16 and a C++20 compiler.
mkdir build && cd build
cmake ..
make -jThis will generate all example executables inside build/src/.
./chat_serverLogs to: chat_server.log
./chat_clientEach client can send messages that are broadcast to all others.
Type /quit to exit.
./mcast_subscriber./mcast_publisherThe publisher sends random ticks (e.g. TICK|AAPL|145.67) to a multicast group (239.192.1.1:5001), and all subscribers receive them in real-time.
./lf_queue_exampleDemonstrates a single-producer/single-consumer lock-free queue where one thread writes and another reads data asynchronously.
./mem_pool_exampleCustom memory pool that allocates and deallocates fixed-size objects efficiently, avoiding frequent heap allocations.
./thread_exampleDemonstrates spawning and managing threads using the helper createAndStartThread().
./logging_exampleLogs various data types to logging_example.log using the custom Logger class:
logger.log("Logging a char:% an int:% and an unsigned:%\n", c, i, ul);Each log entry is timestamped with nanosecond precision.
./socket_exampleSpins up a local TCP server and multiple clients that exchange messages through the event loop.
Useful for understanding the flow of sendAndRecv(), non-blocking I/O, and epoll event handling.
| Component | Description |
|---|---|
| Logger | Lightweight file logger with formatted log support. |
| TCPSocket / TCPServer | Abstractions for non-blocking TCP communication using epoll. |
| McastSocket | Multicast socket layer for market data distribution / pub-sub systems. |
| LFQueue | Lock-free queue for high-performance producer-consumer workloads. |
| MemPool | Fixed-size memory allocator for deterministic allocations. |
| ThreadUtils | Helper utilities for spawning and managing named threads. |
- Non-blocking I/O with
epoll - TCP vs Multicast communication
- Lock-free concurrency primitives
- Efficient memory management
- Logging, tracing, and profiling for network systems
- Thread orchestration and data synchronization
This project is licensed under the MIT License — feel free to use, modify, and share.
Souvik Mukherjee
💼 Analyst SWE @ Zanskar Research
🚀 Building trading infrastructure, OMS/ORMS modules, and low-latency systems in C++
📫 LinkedIn