You are viewing a plain text version of this content. The canonical link for it is here.
Posted to derby-user@db.apache.org by Oskar Zinger <oz...@us.ibm.com> on 2012/08/28 17:56:33 UTC

Derby Network Server - Questions about -h parameter


Hello Derby Community,

I have a question about Derby Network Server start and specifically about
-h option / parameter.

NetworkServerControl(InetAddress address, int portNumber)
This constructor creates an instance that listens on the specified
portNumber on the specified address. The InetAddress will be passed to
ServerSocket. NULL is an invalid address value. The following examples show
how you might allow Network Server to accept connections from other hosts:

//accepts connections from other hosts on an IPv4 system
NetworkServerControl serverControl =
  new NetworkServerControl(InetAddress.getByName("0.0.0.0"),1527);

//accepts connections from other hosts on an IPv6 system
NetworkServerControl serverControl =
  new NetworkServerControl(InetAddress.getByName("::"),1527);

If I use "::" for IPv6 system, will the network server accept connections
coming from IPv4 network, and vice versa?

Thanks,
Oskar

------------------------------------------------------------------
Oskar Zinger
Product Architect - IBM Tivoli Netcool/Impact
ozinger@us.ibm.com

Re: Derby Network Server - Questions about -h parameter

Posted by José Ventura <st...@gmail.com>.
I don't have an answer, but I *think* this depends largely on the
underlying OS. Basically, on some OSs you can listen on "::" and both ipv4
and ipv6 traffic will be delivered to your app; on others, you might need
extra tweaking or two listening sockets:

http://stackoverflow.com/questions/10378471/how-to-support-both-ipv4-ipv6-on-java

Hope that helps...

On Tue, Aug 28, 2012 at 12:56 PM, Oskar Zinger <oz...@us.ibm.com> wrote:

> Hello Derby Community,
>
> I have a question about Derby Network Server start and specifically about
> -h option / parameter.
>
> NetworkServerControl(InetAddress address, int portNumber)
> This constructor creates an instance that listens on the specified
> portNumber on the specified address. The InetAddress will be passed to
> ServerSocket. NULL is an invalid address value. The following examples show
> how you might allow Network Server to accept connections from other hosts:
>
> //accepts connections from other hosts on an IPv4 system
> NetworkServerControl serverControl =
>   new NetworkServerControl(InetAddress.getByName("0.0.0.0"),1527);
>
> //accepts connections from other hosts on an IPv6 system
> NetworkServerControl serverControl =
>   new NetworkServerControl(InetAddress.getByName("::"),1527);
>
> If I use "::" for IPv6 system, will the network server accept connections
> coming from IPv4 network, and vice versa?
>
> Thanks,
> Oskar
>
> ------------------------------------------------------------------
> Oskar Zinger
> Product Architect - IBM Tivoli Netcool/Impact
> ozinger@us.ibm.com
>