This is a 2-user chat application. One user is the server and the other user is the client.
-
Compile the application on both the server and client.
javac tcpchat.java
-
Run the server application on the server.
java ChatServer
-
Run the client application on the client.
java ChatClient
-
The client application will ask for server address. Enter the IP address of the server.
-
Enjoy chatting!
Unfortunately, this application doesn't end gracefully when one end closes the connection.