Frequently Asked Questions
You usually get this exception if your server is either not running, or is not running on the host/port specified in the proxy used by the client.
The best way to debug this is to first run the server with network tracing (property Ice.Trace.Network=2) to determine on which host/port the server is listening. For example, if you run the "hello" demo server, you will get tracing output that looks similar to this:
$ ./server --Ice.Trace.Network=2
[ Network: attempting to bind to tcp socket 192.168.1.34:10000 ]
[ Network: accepting tcp connections at 192.168.1.34:10000 ]
[ Network: attempting to bind to udp socket 192.168.1.34:10000 ]
[ Network: starting to receive udp packets local address =
192.168.1.34:10000 remote address = <not connected> ]
[ Network: attempting to bind to ssl socket 192.168.1.34:10001 ]
[ Network: accepting ssl connections at 192.168.1.34:10001 ]
From the tracing output, you can see that the server listens on three endpoints:
- Incoming TCP connections on host 192.168.1.34, port 10000
- Incoming UDP packets on host 192.168.1.34, port 10000
- Incoming SSL connections on host 192.168.1.34, port 10001
Now try running the client with network tracing. For example, if the client has the wrong host information, you would get tracing like that shown below:
$ ./client --Ice.Trace.Network=2 [ Network: trying to establish tcp connection to 192.168.1.59:10000 ] [ Network: trying to establish ssl connection to 192.168.1.59:10001 ] [ Network: trying to establish tcp connection to 192.168.1.59:10000 ] [ Network: trying to establish ssl connection to 192.168.1.59:10001 ] Network.cpp:536: Ice::ConnectionRefusedException: connection refused: Connection refused
From the information above, you can see that the client is trying to connect to 192.168.1.59 instead of 192.168.1.34. There are several reasons why this could happen:
- You might have made a simple typo in the client configuration.
- Your DNS (name server) might not be set up properly. Try looking up the server's host name with "nslookup" or similar tools to see if DNS returns the correct IP address for the server name.
- Perhaps your server has two IP addresses, but you didn't configure which one it should use.
Of course there are many other possible reasons. With the help of the tracing output, you should be able to find out where the problem lies.