Socket API Functions
This list is a summary of functions or methods provided by the Berkeley sockets API library:
socketcreates a new socket of a certain socket type, identified by an integer number, and allocates system resources to it.bindis typically used on the server side, and associates a socket with a socket address structure, i.e. a specified local port number and IP address.listenis used on the server side, and causes a bound TCP socket to enter listening state.connectis used on the client side, and assigns a free local port number to a socket. In case of a TCP socket, it causes an attempt to establish a new TCP connection.acceptis used on the server side. It accepts a received incoming attempt to create a new TCP connection from the remote client, and creates a new socket associated with the socket address pair of this connection.sendandrecv, orwriteandread, orsendtoandrecvfrom, are used for sending and receiving data to/from a remote socket.closecauses the system to release resources allocated to a socket. In case of TCP, the connection is terminated.gethostbynameandgethostbyaddrare used to resolve host names and addresses. IPv4 only.selectis used to pend, waiting for one or more of a provided list of sockets to be ready to read, ready to write, or that have errors.pollis used to check on the state of a socket in a set of sockets. The set can be tested to see if any socket can be written to, read from or if an error occurred.getsockoptis used to retrieve the current value of a particular socket option for the specified socket.setsockoptis used to set a particular socket option for the specified socket.
Further details are given below.
Read more about this topic: Berkeley Sockets
Famous quotes containing the word functions:
“Mark the babe
Not long accustomed to this breathing world;
One that hath barely learned to shape a smile,
Though yet irrational of soul, to grasp
With tiny fingerto let fall a tear;
And, as the heavy cloud of sleep dissolves,
To stretch his limbs, bemocking, as might seem,
The outward functions of intelligent man.”
—William Wordsworth (17701850)
Related Phrases
Related Words