Archived

This forum has been archived. Please start a new discussion on GitHub.

Connection Refused Exception with Redhat Linux

Hello,

I have a service running on Redhat (uname -a: Linux lakeway 2.4.21-15.0.2.EL #1 Wed Jun 16 23:12:30 EDT 2004 i686 i686 i386 GNU/Linux), a client on Solaris 9.

The service refuses the connection (everything works okay with the service on another Sun box). My sysadmin guy got this from snoop:

[6] # snoop host lakeway
Using device /dev/eri (promiscuous mode)
cactus.lle.rochester.edu -> lakeway.lle.rochester.edu TCP D=10003 S=40826 Syn Seq=4178344468 Len=0 Win=32850 Options=<mss 1460,nop,wscale 3,nop,nop,tstamp 110355863 0,nop,nop,sackOK>
lakeway.lle.rochester.edu -> cactus.lle.rochester.edu TCP D=40826 S=10003 Rst Ack=4178344469 Win=0
cactus.lle.rochester.edu -> lakeway.lle.rochester.edu TCP D=10003 S=40827 Syn Seq=4178476356 Len=0 Win=32850 Options=<mss 1460,nop,wscale 3,nop,nop,tstamp 110355864 0,nop,nop,sackOK>
lakeway.lle.rochester.edu -> cactus.lle.rochester.edu TCP D=40827 S=10003 Rst Ack=4178476357 Win=0

No Ack is coming from the server, apparently.

Does this mean I need to update my version of Redhat?

BTW, I built Ice myself...

Thanks!
Mark

Comments

  • benoit
    benoit Rennes, France
    Hi Mark,

    Can you run your client and server with the --Ice.Trace.Network=2 command line option and post the trace here? This should give us some clues on why your server isn't accepting the connection!

    Benoit.
  • Hi Benoit,

    Here is what the server output:

    ./MSCServer --Ice.Trace.Network=2
    [ ./MSCServer: Network: attempting to bind to tcp socket 127.0.0.1:10003 ]
    [ ./MSCServer: Network: accepting tcp connections at 127.0.0.1:10003 ]

    Here is the client output:

    ./MSCClient --Ice.Trace.Network=2
    [ ./MSCClient: Network: trying to establish tcp connection to 172.20.32.8:10003 ]
    [ ./MSCClient: Network: trying to establish tcp connection to 172.20.32.8:10003 ]
    ./MSCClient: Network.cpp:545: Ice::ConnectionRefusedException:
    connection refused: Connection refused


    Hope this helps.

    Thanks,
    Mark
  • benoit
    benoit Rennes, France
    Your server is listening on the loopback interface not on the network interface as shown by the traces. You need to change the configuration of your object adapter to get it to listen on the network interface instead. For example, the property:
    HelloAdapter.Endpoints=tcp -h 72.20.32.8 -p 10003
    

    will configure the adapter named "HelloAdapter" to listen on the interface with the IP address 72.20.32.8 and the port 10003. See the Ice manual for more information on how to configure the object adapter endpoints.

    Let us know if you need more information!

    Benoit.
  • bernard
    bernard Jupiter, FL
    This also suggests that your Linux server is not properly configured.

    `hostname` should not return 'localhost' or 'localhost.localdomain', but a real hostname.
    See the property Ice.Default.Host in the Ice manual.

    Cheers,
    Bernard
  • Well, it works now. This is how I originally configured it in code:

    adapter_ = communicator()->createObjectAdapterWithEndpoints(
    "MSCAdapter",
    "tcp -h lakeway -p 10003");


    This is what I did to get it to work (in response to you guys):

    adapter_ = communicator()->createObjectAdapterWithEndpoints(
    "MSCAdapter",
    "tcp -h 172.20.32.8 -p 10003");

    and it works.

    Why didn't the first work? When I do 'host lakeway', I get 172.20.32.8.
  • bernard
    bernard Jupiter, FL
    Your original code is correct (even if he does not work :) ). It's really a network configuration problem on lakeway, most likely in /etc/hosts.

    `host lakeway` returns 172.20.32.8 when run from lakeway?

    Cheers,
    Bernard