If 10 years from now, when you are doing something quick and dirty, you suddenly visualize that I am looking over your shoulders and say to yourself, "Dijkstra would not have liked this," well that would be enough immortality for me.
The sockets programming interface is probably the most commonly used interface for writing TCP/IP based applications. The sockets API is largely protocol agnostic, so adding support for IPv6 has proved to be relatively easy. To prevent inconsistencies between the implementations, some standards have been produced to encourage a unified API (RFC 3493 and RFC 3542).
Familiar sockets function calls such as
accept all remain unchanged, apart from the
introduction of a new address family
AF_INET6 that is used instead of
AF_INET. IPv6 socket addresses are stored
sockaddr_in6 rather than a
sockaddr_in; so much is self-explanatory. More
sockaddr_storage is provided which is large enough to store
any protocol address. This is intended to make it easier to write
protocol-independent code. Previously,
sockaddr was sometimes used for this purpose, but the size
chosen for this structure was too small on many systems.
Apart from the structures, the main change to the API for IPv6 is
the provision of functions for looking up and printing IPv6 hostnames
and addresses. The most important of these are
getnameinfo. These are replacements ...