Search code examples
ctcpipv6

I am getting error in IPv6 socket connection


My server is creating a IPV6 socket.

On client I am creating a IPV4 socket. Now, In the connect API on client side I am passing the socket descriptor of IPV4 and IPV6 address structure.

INET_connect( sock,(SocketAddress *)in6_addr,(int)sizeof( sockaddr_in6 ) ) == 0 )

where

struct sockaddr_in6 in6_addr;

I am getting error in connection. Is it due to this or some other reason ? Please note that my server is IPV6(having an IPV6 address)


Solution

  • You must use an IPV6 socket to connect to an IPV6 address, or use a tunneling service which will translate traffic from IPV4 addresses to and from IPV6 addresses.