protocol family unavailable

R

robby

I am using a generic tcp connect on hpux 11i with an ipv6 address.
I am able to make the connection with an ipv4 address.

host_addr = InetAddress.getByName(host);
host_sock_addr = new InetSocketAddress(host_addr, port);
try
{
socket = new Socket();
}
catch (SocketException e)
{
//error
}

try
{
socket.connect(host_sock_addr, 1000);
}
catch (SocketException e)
{
System.out.println(" err "+e.toString() + " "
+Err.SOCKET_CONNECT_ERR );
return retval;
}

output:
java.net.SocketException: Protocol family unavailable 56
 
R

robby

I am using a generic tcp connect on hpux 11i with an ipv6 address.
I am able to make the connection with an ipv4 address. [...]
java.net.SocketException: Protocol family unavailable 56

Do you have a question or are you just in the sharing mood?

Is IPv6 installed and enabled on your system?
My question would have been 'why am I getting this error?'
I do have dual stack for ipv6 and ipv4, so yes ipv6 is installed.
I used the preferIPv4Stack="false" flag and it appears to have fix the
problem,
but I have not fully tested it on my ipv4 box where I don't use ipv6
at all.
Thanks.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top