View RSS Feed

Java Socket

What Is a Socket?

Rate this Entry
by , 04-25-2012 at 11:13 PM (426 Views)
At some specific computer, server usually runs. It consists of a socket which remains bound to some particular port number. Serverís function is to hold or wait and listen to socket if some client sends the connection request.

On the client-side: Client is aware of the machine at which server runs has a hostname and a port number at which server listens. Client makes an attempt at the machine and port of the server to rendezvous with server so that to make the connection request. Identification of client is necessary because server will be binding it to that port number which will be used while making connections. Usually system assigns this thing.

Name:  1.jpg
Views: 47
Size:  5.2 KB
Connection Request

Server usually accepts the request of connection if everything is going well. New socket is being provided at the acceptance to server which remains bound to similar port. It also consists of a remote end point. New socket is needed for listening the original socket so the connected clientís needs are fulfilled.

When acceptance of the connection is done at the client side, socket is created successfully and can be used by the client so that to do communication with server.
Server & client can then communicate by reading or writing, from their sockets.

Submit "What Is a Socket?" to Facebook Submit "What Is a Socket?" to Digg Submit "What Is a Socket?" to Submit "What Is a Socket?" to StumbleUpon Submit "What Is a Socket?" to Google