Consultor Eletrônico



Kbase P73430: What is a Socket?
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   11/04/2005
Status: Verified

GOAL:

What is a Socket?

FIX:

A socket is the endpoint of a connection over a TCP/IP network, much like a phone is the endpoint of a connection in the telephone network.

A socket is the combination of a TCP port and an IP address.

Ports are logical interfaces for applications, and they are assigned numbers.

For example, The Web's HTTP protocol is located at port 80. Using the telephone analogy, the TCP port is then like a telephone number and the IP address is the location of the phone. A socket is like a phone that has been assigned a phone number. However, a typical host can have many sockets active at the same time (this is called multiplexing).

A socket is created during a connection setup between two systems when a process makes a request to a remote machine to open a connection at a specific port. Once the connection is set up, data transfers can begin.

Sockets are the main abstraction of the socket interface, which was originally developed in the Berkeley implementation of UNIX. The socket interface is an API, and a socket is the place where an application process makes a connection to some other process over a network. See "Sockets API."

RFC 675 (Specification of Internet Transmission Control Program, December 1974) provides a clear description of TCP, ports, and sockets. See section 2.2 ("Sockets and Addressing").