Tuesday, July 26, 2011

What is Socket and PORT in Computer Network Programming

   A port represents an endpoint or "channel" for network communications. Port numbers allow different applications on the same computer to utilize network resources without interfering with each other.

The purpose of ports is to differentiate multiple endpoints on a given network address. You could say that a port is a virtualised endpoint. This virtualisation makes possible multiple concurrent connections on a single network interface. 

 A socket represents a single connection between two network applications. These two applications nominally run on different computers, but sockets can also be used for interprocess communication on a single computer. Applications can create multiple sockets for communicating with each other. Sockets are bidirectional, meaning that either side of the connection is capable of both sending and receiving data. Therefore a socket can be created theoretically at any level of the OSI model from 2 upwards.

The combination of an IP address and a port is strictly known as an endpoint and is sometimes called a socket. A socket is not bound to TCP/IP, it can be any protocol

No comments: