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
> 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?
http://h20293.www2.hp.com/portal/swdepot/displayProductInfo.do?productNumber=T1306AA
(http://tinyurl.com/2j8wdn)
/gordon
--
robby - 08 Oct 2007 19:05 GMT
> > 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.
[quoted text clipped - 4 lines]
>
> 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.
>host_addr = InetAddress.getByName(host);
>host_sock_addr = new InetSocketAddress(host_addr, port);
please dump out host and host_addr.

Signature
Roedy Green Canadian Mind Products
The Java Glossary
http://mindprod.com