TCP Server and Client in Java

This program simply transmits the message entered at client to server.

TCP Server Program

tcpserver.java
  1. span style="color: #006699;">java.io.BufferedReaderjava.io.InputStreamReaderjava.net.ServerSocketjava.net.Socket"Server running...""Client sent : "+message); }
  2. }
  3. }

TCP Client Program

tcpclient.java
  1. span style="color: #006699;">java.io.BufferedReaderjava.io.DataOutputStreamjava.io.InputStreamReaderjava.net.Socket"127.0.0.1""Type message : ""\n");
  2. csock.close();
  3. }
  4. }
  5. }