All work

PortChat

A Python network chat application built with sockets and threads.

Archive

The problem

Handling several conversations at once requires the server to manage concurrent connections without blocking message delivery or letting threads interfere with shared state.

What I built

PortChat implements a server-client architecture for text communication across a network. A Python server listens on a port and handles clients in separate threads, allowing multiple people to connect and exchange messages. Commands cover connecting, sending messages, and exiting.

  • Use Python sockets to connect clients to a listening server.
  • Run each incoming client connection in a separate thread.
  • Use locks to protect shared resources and address race conditions.
  • Provide commands for connecting, sending messages, and disconnecting.

The result

A Python network chat application built with sockets and threads.

Keep exploring

Find My Parcel