| < Day Day Up > |
|
In this chapter, we continue looking at the details of the Sockets API, in this case some advanced functions and some other functions whose usage is rare. This discussion, as in the prior chapter, is based on the Linux API. The prototypes and usage apply to other implementations as well. The Sockets functions that are discussed in this chapter are shown in Table 4.1. All code for this chapter can be found on the companion CD-ROM under /software/ch4.
Function | Description |
---|---|
select | Provides event notification of socket events |
getsockname | Returns the address of the local socket |
getpeername | Returns the address of the remote socket |
getsockopt | Returns the value of a socket option for a given socket |
setsockopt | Manipulates a socket option for a given socket |
shutdown | Closes a socket with more control |
gethostname | Retrieves the name of the host on which this stack operates |
sethostname | Sets the name of the host on which this stack operates |
gethostbyaddr | Returns the FQDN for a given IP address |
gethostbyname | Returns the IP address for a given FQDN |
getservbyname | Returns the port number for a given service string |
getservbyport | Returns the service string for a given port number |
The following subsections illustrate the API calls, and discuss any special characteristics of their application and common problems that are associated in their use.
| < Day Day Up > |
|