User Tools

Site Tools


glossary:socket

Socket

A socket is a software abstraction for the communication channel that an application uses to exchange application protocol messages between client and server processes.

A client will initiate contact with a server by attempting to open a connection with a “server socket” (defined by the server host's IP address and the port number of the server process). The server socket represents the server-side of the application process and is usually a passive process (or daemon) that awaits connection requests from clients, and then processes those requests when they come in.

Once the connection is established, messages can flow back and forth between client and server (the client's socket is identified by the client's host IP address and a randomly assigned socket port number).

The actual implementation of the socket is implemented by the operating system of the host and need not concern the application developer who's only decision is whether to use TCP or UDP. For connection-oriented communications using TCP sockets, the socket behaves like a file from which the application can read data and to which it can write data. The data itself represents application protocol messages and will be handled as a binary data stream. For connectionless communications using UDP sockets, the application is responsible for creating datagrams from the application data, sending those datagrams through the socket and unpacking datagrams received from the other party.


Glossary : A | B | C | D | E | F | G | H | I | J | K | L | M | N | P | Q | R | S | T | U | V | W | X | Y | Z

glossary/socket.txt · Last modified: 2011/01/14 12:47 by 127.0.0.1