We are trying to support ipv6 in our module which is already IPV4 compliant. This module can take a role of client or server dynamically. Also our module (in server mode) is supposed to accept IPV4 as well as IPV6 connections. The sockets are of TCP sockets and we are using linux 2.4.20 kernel.

As I am new to socket programing and IPV6, I am looking for answers to the questions:

1. If my server is already listening on a port (say 50000) using AF_INET socket, can i create a AF_INET6 socket which should listen on the port 50000?

2. What is the actual usage of getaddrinfo()? Is it like for IPV6 we should use getaddrinfo() function?

3. Is there any ground rule that getaddrinfo() should be used only on client side or should be used only on server side?

4. Is there any possibility of using one socket to accept IPV4 connections as well as IPV6 connections? If there is a possibility can I get some tips?

Please note that the sockets are TCP sockets.

thanks & regards,