A real-time stock quote streaming system built with Rust. This workspace implements a client-server architecture where the server generates and streams mock stock quotes to clients via UDP, while managing subscriptions over TCP.
Highlights:
- Dual-transport networking: TCP for subscription management, UDP for the quote stream
- Multithreaded server with concurrent per-client processing
- Graceful handling of client connects/disconnects mid-stream
Stack: Rust · TCP/UDP · Multithreading
This project is organized into three main crates:
- quote-server: The server application that handles ticker subscriptions and streams quotes.
- quote-client: The client application that subscribes to tickers and displays the live stream.
- quote-streaming: A shared library containing common data structures and serialization logic.
Rust (latest stable) and Cargo
-
Prepare a Tickers File: Create a file named
tickers.txtwith some ticker symbols, one per line (e.g., AAPL, MSFT, TSLA). -
Start the Server:
cargo run --bin quote-server -- --tickers-file tickers.txt
-
Start the Client: Open a new terminal window and run:
cargo run --bin quote-client -- -a 127.0.0.1 -p 5152 args -t AAPL -t MSFT
For more detailed information about each component, please refer to the individual README files in their respective directories: