Friday, May 23, 2008

SOCKET

In networking Clients and the servers can communicate through socket.They are considered as the end points of the internet communication.In the internet ,connections are made with the help of TCP.so basically socket is used for the purpose of communication.Client will always create the client socket and the server is connected to it.It includes two address,namely host address and the port address.
Host address always denotes the IP address and port address holds the address of communication port.This socket facilities are provided in the 'C' language.The socket is not used for along time,socket is closed using close system call.If the socket is closed successfully then it will return 0, otherwise -1.
Server program uses the well known port address associated with the application protocol.so before every time when the application program is going to transfer data,it should call the socket to creating the endpoint to the communication. A client can establish a connection on a socket just by calling connect.this connect will establish a virtual circuit between the client and the server.Server can accept the request by listening to the call.the family can be identified by address or the protocol.

No comments:

 
ss_blog_claim=347363fab46bcf86191b0960721015b5