Wednesday, September 11, 2013

Sockets

One of the various types of files that are in use on a linux system is the socket. Think of a socket as a pipeline through which data can be transmitted from one end, resulting in the same data being available on the other end without modification. Such a pipeline can be constructed independently of the programs utilizing it, under some circumstances.

There are two main types of sockets, an internet socket and a UNIX socket.  An internet socket can be used for communication over TCP / UDP and others, while a UNIX socket is only for communications within a single physical computer.

A socket can either be uni-directional or bi-directional, depending on the protocol being used. When a socket is uni-directional, once the socket is created, one process can connect to the socket for reading, and the other socket for writing, but a bi-directional socket supports both for both processes.

Systems such as DBus use sockets internally to handle the low level work of the services they offer. Other programs, like Apache, or SystemD, can do some interesting things with sharing sockets among children processes.

Here's the obligatory wikipedia pages to reference for more info http://en.wikipedia.org/wiki/Unix_domain_socket http://en.wikipedia.org/wiki/Network_socket

No comments:

Post a Comment