Your Browser is not longer supported

Please use Google Chrome, Mozilla Firefox or Microsoft Edge to view the page correctly
Loading...

{{viewport.spaceProperty.prod}}

bind() call with AF_INET6

&pagelevel(4)&pagelevel

With AF_INET6, name comprises an IPv6 address and a port number. name is passed in a variable of type struct sockaddr_in6 (see "sockaddr_in6 address structure of the AF_INET6 address family ").

The following program extract illustrates how a name is assigned to a socket.

#include <sys/types.h>
#include <netinet/in.h>
...
struct sockaddr_in6 sin6;
...
/* The statements which supply "sin6" with an Internet
   address and a port number must be inserted here.*/ 
...
bind(s, (struct sockaddr *)&sin6, sizeof sin6);