Difference between Socket and ServerSocket Class

Comparison between Socket and ServerSocket Class

Difference between Socket and ServerSocket Class in Tabular Form

  • The Key Difference between Socket and ServerSocket Class is that Socket is used at the client side whereas ServerSocket is used at the server side.
  • More major Difference between Socket and ServerSocket Class is below the table.
Socket and Server Socket Difference
Socket and Server Socket Difference

Comparison Chart

Socket Server Socket
1 Socket used at Client side. Server Socket used on the server side.
2 It is used for sending the request to the server. It is used for listening to the client.
3 This class encapsulates the behavior of the active side. This class encapsulates the behavior of the passive side.
4 Establish connection with connect() Establish connection with listen()
5 Socket s = new
Socket (“localhost”,1111);
ServerSocket ss = new ServerSocket(1111);




More Difference