Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.


  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

59. Sockets: Internet Domains > An Internet Domain Sockets Library

An Internet Domain Sockets Library

In this section, we use the functions presented in Protocol-Independent Host and Service Conversion to implement a library of functions to perform tasks commonly required for Internet domain sockets. (This library abstracts many of the steps shown in the example programs presented in Client-Server Example (Stream Sockets).) Since these functions employ the protocol-independent getaddrinfo() and getnameinfo() functions, they can be used with both IPv4 and IPv6. Example 59-8 shows the header file that declares these functions.

Many of the functions in this library have similar arguments:

  • The host argument is a string containing either a hostname or a numeric address (in IPv4 dotted-decimal, or IPv6 hex-string notation). Alternatively, host can be specified as a NULL pointer to indicate that the loopback IP address is to be used.


  

You are currently reading a PREVIEW of this book.

                                                                                                                    

Get instant access to over $1 million worth of books and videos.

  

Start a Free Trial


  
  • Safari Books Online
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint