← Back to the collection
SYSTEMS / 2021 / HISTORICAL APPLICATION

A conversation, packet by packet.

UDP Messenger

A desktop chat experiment with direct messages, group broadcast, and retrieval of stored conversations.

MEDIUM
  • Java
BUILT WITH
  • Swing
  • DatagramSocket
  • Threads
ACCESS

Public source

Two Java Swing messenger clients exchange direct replies and a group message through a local UDP server
Actual Swing applications · verified local UDP delivery · direct replies and group chat.Open film ↗
01

An interface over a protocol

Swing clients send datagrams to a server. Login and message handling are distinct flows, client handlers run on threads, and group membership is maintained separately from direct-message recipients.

02

A little persistence

The server stores conversation history in files and sends older messages when a client joins. The code makes the path from a user action to a packet, a handler, and a visible message unusually direct.

SYSTEM SKETCH / CONCEPTUAL OVERVIEW
CLIENT A ── UDP ──► SERVER ── UDP ──► CLIENT B
                       │
                 conversation log
                       │
                 GROUP BROADCAST
A reading of the architecture, not an application screenshot.
SYSTEM MAP / MESSAGE FLOW / SERVICE BOUNDARIES

From a button press to a delivered datagram.

Client · Swing → Server · login socket: login datagram. Server · login socket → Client + group maps: register. Client · Swing → clientHandler: message datagram. Client + group maps → clientHandler: resolve destination. clientHandler → chat_logs: store / retrieve. clientHandler → Client · receiver: direct / group delivery.12345601 / SENDERClient · SwingLogin / send / join groupClient DatagramSocket02 / PORT 1776Server · login socketRegister name and addressCreate clientHandler thread03 / PORT 9999clientHandlerReceive / parse datagramDirect recipient or group04 / ROUTING STATEClient + group mapsNames → address / portGroup memberships05 / FILESYSTEMchat_logsWrite conversation filesRead earlier messages06 / RECIPIENTClient · receiverReceive datagramAppend to conversation view
  1. 01 / sender

    Client · Swing

    Login / send / join group

    Client DatagramSocket

    • login datagram → 2. Server · login socket
    • message datagram → 3. clientHandler
  2. 02 / port 1776

    Server · login socket

    Register name and address

    Create clientHandler thread

    • register → 4. Client + group maps
  3. 03 / port 9999

    clientHandler

    Receive / parse datagram

    Direct recipient or group

    • store / retrieve → 5. chat_logs
    • direct / group delivery → 6. Client · receiver
  4. 04 / routing state

    Client + group maps

    Names → address / port

    Group memberships

    • resolve destination → 3. clientHandler
  5. 05 / filesystem

    chat_logs

    Write conversation files

    Read earlier messages

    • 06 / recipient

      Client · receiver

      Receive datagram

      Append to conversation view

      1. 1Client · Swing Server · login socketlogin datagram
      2. 2Server · login socket Client + group mapsregister
      3. 3Client · Swing clientHandlermessage datagram
      4. 4Client + group maps clientHandlerresolve destination
      5. 5clientHandler chat_logsstore / retrieve
      6. 6clientHandler Client · receiverdirect / group delivery
      The capture copy repairs recipient routing on the shared socket and history attribution. UDP delivery, authentication and transport security are not guaranteed by this study.
      Read from the implementation
      • Client.java
      • Server.java · clientHandler
      • clientDriver.java / serverDriver.java
      03

      A conversation on the local machine

      The film runs two clients and a server on loopback using new test messages. Delivery is checked in the receiving client before the capture proceeds. A routing bug caused shared-socket handlers to use their own recipient instead of the packet recipient; this was repaired in the isolated capture copy, along with history attribution. The historical repository is unchanged.

      04

      The boundary of the experiment

      This is a networking study. Authentication, transport security, and delivery guarantees are not claimed. The recording contains only locally generated test conversations.

      CONTINUE EXPLORING

      Making Propane →

      A synchronization exercise that coordinates eight hydrogen threads and three carbon threads to form propane.

      2021
      • Java