This is a Python3 program that allows you to chat over a LAN using sockets. The program dynamically determines the buffer size at runtime, optimizing bandwidth usage by avoiding explicit buffer size definitions.
To use the chat application, follow the instructions below:
-
Start the server:
python3 server.py -ht 127.0.0.1 -p 5000
This will create a server that listens for incoming connections on the specified host (
-ht
) and port (-p
). -
Start the client:
python3 client.py -ht 127.0.0.1 -p 5000
This will connect a client to the server using the specified host (
-ht
) and port (-p
). -
Chat away!
Once the client is connected to the server, you can start sending messages back and forth between the server and client.
- Make sure you have Python 3 installed on your machine.
- The host (
-ht
) should be the IP address of the machine running the server. - Choose a free port (
-p
) for communication.
Feel free to modify and enhance this chat application to meet your specific requirements. Happy chatting!