socket

how to create a socket ?
why to bind a socket?
when we use a socket?

A socket is a data-structure used for interprocess communications, generally associated with network communications. You create them via access to kernel system calls that create sockets. These system calls may be C programming interfaces to the kernel, or they may be created via higher level languages such as PERL, PHP, PYTHON, etc.

When you create a socket, you only create the data structure. You must bind the process to the data structure in order to listen, read, and write between the socket and the process which is bound to the socket.

Sockets are generally used between processes over the network. I suggest you study Steven's book, "UNIX Network Programming," to gain an appreciation of sockets and network programming. Here is an Amazon.com link to a later (maybe better) edition of UNIX Network Programming by Rich Stevens (a true UNIX hero!)

<CENTER>
<A HREF="http://www.amazon.com/exec/obidos/ASIN/013490012X/silkroadcom"><IMG SRC="http://images.amazon.com/images/P/013490012X.01.MZZZZZZZ.jpg" border="0" alt="cover" hspace="3" vspace="3"></A>

<A HREF="http://www.amazon.com/exec/obidos/ASIN/0130810819/silkroadcom"><IMG SRC="http://images.amazon.com/images/P/0130810819.01.MZZZZZZZ.jpg" border="0" alt="cover" hspace="3" vspace="3"></A>

</CENTER>

Also, here are more discussions and pointers in a related thread:

http://forums.unix.com/showthread.php?threadid=75