I have no experience in IPv6 programming, perhaps this chapter will be filled by others or moved away to another HOWTO.
More Information can be found here:
Basic Socket Interface Extensions for IPv6
Advanced Sockets API for IPv6