A teaching lab for the eCommerce course module Beyond HTTP. The code base demonstrates how event-driven integrations can pair reliable TCP control channels with lightweight UDP broadcasts to keep remote clients up to date.
Lab5/- Swing/AWT client that displays live gate assignments for two partner airlines. It registers itself over TCP and listens for UDP notifications.Lab5_Server/- Server-side utilities that track subscribed listeners, play back CSV-based destination data, and broadcast periodic updates.
- Registration handshake (TCP 8189): Clients announce their IP and UDP port via
GateInformationBoard.Register(). The server records each listener in a simple in-memory table and acknowledges withHELLO. - Status fan-out (UDP 51000+):
GateReporterthreads synthesize gate changes and fire multicast-style datagrams (AIRLINE,DEST,SEAT,#,GATE,#). Clients update their boards on receipt. - Interfaces: All UI code uses Java AWT (
Frame,TextArea,Canvas), keeping the lab self-contained and platform-portable.
- Java Development Kit (JDK) 8 or later (older AWT APIs generate deprecation warnings on newer JDKs but still run).
- Optional: PNG assets referenced by
Logo(e.g.,carmoncar.png,vanderides.png). Provide your own images or adjust filenames as needed.
- Compile
# Server-side classes cd Lab5_Server javac *.java # Client-side classes cd ../Lab5 javac *.java
- Run the server (one per airline/port)
cd ../Lab5_Server java GateReportingSystem CarmonCar- The argument seeds the airline name embedded in outbound messages.
- Server listens for registrations on TCP 8189 and sends UDP bursts from an ephemeral port.
- Run the client
cd ../Lab5 java GateKeeperGateKeeperlaunches two boards (one per airline). Adjust hard-coded IP addresses (e.g., set to127.0.0.1) to match your local setup.
Note: When running everything locally, update
GateKeeperto use your machine's IP and align UDP port numbers (51000,51001, etc.) with those emitted by the servers you start.
- Switch to localhost networking and observe messages in Wireshark to highlight TCP vs. UDP behavior.
- Add a third airline by cloning the
GateInformationBoardand launching anotherGateReportingSysteminstance on a new UDP port. - Extend
GateReporterto read real schedule data or integrate with a RESTful feed, then compare the push model with polling over HTTP.
- Moving "beyond HTTP" by showcasing lighter-weight protocols for real-time updates.
- Managing stateful subscriptions without heavy infrastructure (simple socket registry).
- Understanding the trade-offs between delivery guarantees (TCP) and latency (UDP).
Original materials prepared for Princeton University's ORF 401 eCommerce course module on distributed systems. Folder names and class structure align with the Lab 5 assignment.