Nat Gross wrote:
Although I am using the -h option on the server, a client still can't
connect due to 'connection refused'.
On machine whose ip address is: 192.168.1.112 <http://192.168.1.112>, I
tried
1. startNetworkServer -h 192.168.1.101 <http://192.168.1.101>
2.startNetworkServer -h 192.168.1.0 <http://192.168.1.0>
3.startNetworkServer -h 0.0.0.0 <http://0.0.0.0>
But when trying to connect from 192.168.1.101 <http://192.168.1.101>, I
get the connection refused message.
The firewall on the 112 machine is set to allow all traffic from and
to the 101 machine.
I believe startNetworkServer (or any of the other scripts) does not pass any
options you specify on the command line along to the network server, which means
that the -h option you specified is ignored, and your server will only listen on
the local loopback interface.
Some possible solutions:
a) Edit the startNetworkServer script to include the -h option (you can either
hard code the option or make the script more advanced by reading options from
the command line.)
b) Use derbyrun.jar (available with Derby 10.2.1.6 or newer) instead, for
example:
java -jar lib/derbyrun.jar server start -h 0.0.0.0
c) Invoke the Network Server main class directly, for example:
java -cp lib/derbynet.jar org.apache.derby.drda.NetworkServerControl -h 0.0.0.0
Besides, I think the first and second values of the -h option you specified will
not work the way you may think. The -h option specifies which interface the
server will listen on, so specifying the IP address of another host won't help.
"-h 192.168.1.112" and "-h 0.0.0.0" should work, though.
Hope this helps,
--
John