If Socket
represents client side and ServerSocket
represents server side, why Socket.read
reads the data from server side? I\'m really con
ServerSocket
is created to bind
to a port and listen
for a connect
from a client. So, a server just waits for a conversation and doesn't start one.
ClientSocket
is created to connect
to a listen
ing server. The client initiates the connection.
Example: Think of an inbound call center as an example. These services are servers. They don't initiate a call but wait for a call to come in from clients. Once the calls are in, they can engage in a two way conversation.