-
Notifications
You must be signed in to change notification settings - Fork 0
Client Group3
GiZano edited this page Jan 23, 2026
·
1 revision
The Group 3 Client is a lightweight, thread-safe Command Line Interface (CLI) application. It prioritizes low latency and code clarity, serving as a reference implementation for the shared protocol.
Since the client resides in client/Group3/ but depends on utils.py in the root, we utilize a dynamic system path fix:
import sys, os
sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), '..', '..')))
import utilsThis allows the client to run without manually moving files or setting environment variables.
To prevent the UI from freezing while waiting for messages, the client uses Python's threading module:
- Main Thread: Handles user input and sending messages.
- Daemon Thread: Background listener for incoming TCP packets.
The client utilizes utils.get_local_ip() to determine the machine's actual network address, rather than hardcoding 127.0.0.1.
- Ensure the Server is running before starting the client.
cd client/Group3
python client.py- Login: Enter your desired username.
-
Addressing: Input the target username when prompted with
To:. - Sending: Type your message.
-
Receiving: Incoming messages appear asynchronously as
>>> Sender: Message.
-
Issue: The input prompt (
To:) may be overwritten visually when an incoming message arrives.-
Fix Planned: Implement
cursesor purely asynchronous input handling.
-
Fix Planned: Implement
- Feature: Add color-coding for different senders.