Server - Listens for incoming connections from clients and handles communication between them. Client - Connects to the server and sends/receives messages. Listens for incoming client connections.