Java Socket's and ServerSocket's
by, 04-25-2012 at 11:40 PM (676 Views)
When TCP/IP connection is needed to be opened by a client to the server, Java Socket is used for it. TCP port as well as IP address is being told to the socket so that to make the connection and rest of the work is done by Java.
Server which listens to incoming connections could be run at some TCP port by using the Java ServerSocket. When client makes a connection through client socket to the ServerSocket of server, an assignment of socket is done to that connection at server. Now, server & client would be communicating Socket-to-Socket.