Archived

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

Connection Refused

Hello,

when I try to get a connection, I get the following Error-Message:

Ice::ConnectionRefusedException: connection refused: error: 10061

What does this Error-Code mean?

Thanks for your help,
Susanne

Comments

  • matthew
    matthew NL, Canada
    You should always specify your platform and Ice version when asking specific questions like this.

    In this case, the error code is WSAECONNREFUSED, meaning connection refused.

    Windows Sockets Error Codes (Windows)

    It means that the server is not listening on the port you are attempting to connect with.
  • Thanks, but the Ports on both sides are correct and both, the client and the server-part are running on one machine (windows XP). The problem doesn't occur if I use Ice for Client and Server or Ice for the Server-Part and IceE for the Client-Part. But running the Server with IceE is the Problem. I use IceE for Java 1.2 with the IBM J9 (Java Micro Edition CLDC 1.1 with MIDP 2.0, IBM WebSphere Everyplace Micro Environment 5.7.1 for Palm OS). the development platform for the server is Eclipse Equinox.
    Can you give me an advice?

    Here the server-side code:

    ic = Ice.Util.initialize(args);
    Ice.ObjectAdapter adapterAppLayer =
    ic.createObjectAdapterWithEndpoints(
    "ApplicationLayerAdapter", "default -p 10000");
    Ice.Object object = new ApplicationLayerFunctionsI();
    adapterAppLayer.add(object, ic.stringToIdentity("ApplicationLayer"));
    adapterAppLayer.activate();
    ic.waitForShutdown();

    And the client-side code:

    try {

    ic = Ice::initialize(argc, (char**)args);
    Ice::ObjectPrx base =
    ic->stringToProxy("ApplicationLayer:default -p 10000");
    finder = ApplicationLayerFunctionsPrx::checkedCast(base);
    if (!finder) {
    throw "Invalid proxy";
    }
    } catch (const Ice::Exception& ex) {
    cerr << ex << endl;
    status = 1;
    } catch (const char* msg) {
    cerr << msg << endl;
    status = 1;
    }

    Thanks,
    Susanne
  • dwayne
    dwayne St. John's, Newfoundland
    You may need to explicitly set hosts in your endpoint strings using the -h parameter. For example
    "tcp -h 127.0.0.1 -p 10000"
    
    for the loopback interface, or use whatever host name/ip that fits your needs.
  • Great! That's it! Thanks