A simple command-line chat application built with Python using sockets and threading for real-time communication between a server and client.
- Real-time bidirectional communication
- Support for multiple client connections
- Clean exit mechanism with 'bye' command
- Cross-platform compatibility (Windows/Unix)
- Clear console interface
- Graceful handling of unexpected disconnections
- Python 3.x
- Clone the repository:
git clone https://github.com/CollinsKipkemoi/CLI-Chat-Application.git
cd CLI-Chat-Application- Start the server:
python server.py- Start the client in a different terminal:
python client.py- Start chatting:
- Type your message and press Enter to send
- Type 'bye' to exit the chat
- The server can shut down all connections by typing 'bye'
- Listens on port 5000
- Handles multiple client connections using select
- Broadcasts messages to connected clients
- Manages client disconnections gracefully
- Connects to the server on localhost:5000
- Uses threading for simultaneous message sending and receiving
- Provides a clean console interface
- Handles server disconnection gracefully
bye: Exit the chat (works for both client and server)- Server's 'bye': Shuts down the server and disconnects all clients
- Client's 'bye': Disconnects the client while keeping the server running
- Handles unexpected client disconnections
- Manages server shutdown gracefully
- Cleans up resources properly
- Clear error messages for common issues
- Fork the repository
- Create your feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request