This program is a simple chat client that allows you to connect to a server, send messages, and receive messages from the server and potentially other clients.
User must have JDK 22 to run this program
Can get it from here:
- Connects to a server at a specified IP address and port (default 7777).
- Prompts the user for a username to identify themselves on the server.
- Sends messages typed by the user to the server.
- Receives messages from the server and displays them on the console. (STILL NOT IMPLEMENTED)
- Program.java: This class contains the main function of the client. It prompts the user for the server address and username, attempts to connect to the server, and enters a loop that continuously sends messages entered by the user and receives messages from the server.
- The program uses a Scanner object to get user input for server address and username.
- It establishes a connection to the server using a Socket object.
- It uses InputStream and OutputStream objects to communicate with the server (send and receive messages).
- The program keeps trying to connect to the server in a loop if the connection is lost.