Skip to content
IP FediuninFull-Stack & AI Engineer
← All case studies

Case 04 · Networking / Backend / Client-Server Architecture

Internal Corporate Messenger

A corporate messaging system on Python sockets

Overview

A private messenger for employees inside an organisation. The core of the project is networking: clients exchange messages through a server over TCP connections, and UDP is used where it fits.

Project work

The charts are computed by this case's model on synthetic data — the same model that runs the interactive demo. They show what the approach changes, not figures from a client's system.

What I did

  1. Client-server app on Python sockets
  2. Connecting and disconnecting clients
  3. Many simultaneous connections
  4. Network error handling
  5. UDP where speed matters more

Before

  • Team chat depends on external services
  • No private channel inside the organisation's own network

After

  • Messages go through the organisation's own server
  • One server serves many clients at the same time
  • A dropped client or a network error does not stop the server

Messages delivered intact

100%of messages arrive complete and in order at 10% packet loss

  • UDP: no acknowledgements21%
  • TCP: acknowledged, resent if lost100%
A three-part message to three desks, 60 sends per transport, loss on every hop.

How it works

A model of the system you can run: watch requests and data move through the components. It is a simplified reconstruction on synthetic data, not the production code.

What is happening

Send a message over TCP or UDP and add network loss to see the difference. Desk 1 is not connected yet: its first message starts with a handshake.

The model runs in the browser on synthetic data. Times on the cards are illustrative, and motion is slowed down so the path can be followed.

Send a message

Protocol

Network loss

Sender

TCP connections

  • Desk 1 offline
  • Desk 2 online
  • Desk 3 online
  • Desk 4 online

What the clients received

This shows which parts of the message reached each client.

TCP guarantees delivery and order at the cost of acknowledgements and retransmissions. UDP is simpler and never waits, but a lost datagram is gone — it fits where fresh data matters more than complete data.

Engineering detailsThe full write-up: problem, architecture, implementation decisions and outcome.

Problem

Employees of an organisation need a private channel that works inside their own network and does not depend on external services. That takes a client-server application of its own: a server that accepts connections and delivers messages, and clients at the workplaces.

Solution

A messenger of the organisation's own, built on Python sockets: a central server holds TCP connections with the clients and forwards messages between them, and UDP is used where speed matters more than guaranteed delivery.

My role

  • Built a client-server application that exchanges messages over TCP connections with Python sockets.
  • Implemented connecting and disconnecting clients and passing messages through the server.
  • Organised the server's work with several simultaneous connections.
  • Implemented handling of network errors.
  • Used UDP for the network tasks where it fits.

Technical architecture

A central server accepts client connections and keeps them open. A client sends a message to the server, and the server forwards it to the recipients over their connections. The server is the single point every message passes through, so access and delivery rules live in one place.

Implementation

  • Connection lifecycle. Connecting, exchanging data and closing are handled explicitly; a client dropping off must not bring the server down.
  • Many connections at once. The server serves several clients at the same time and keeps track of each connection's state.
  • TCP and UDP for their purpose. TCP guarantees delivery and order — the basis of messaging. UDP needs no connection or acknowledgements and fits tasks where speed matters more than guaranteed delivery.
  • Network errors. Broken connections and unreachable recipients are a normal situation, not an exception that stops the work.

Functional outcome

Employees exchange messages through their own server inside the organisation's network. The server serves several clients at once and delivers messages to the connected recipients.

Need a system like this?

Tell me about the problem — I'll come back with questions and a proposed approach.