Results 1 to 8 of 8

Thread: ICE-E in MFC connection refused

  1. #1
    Maestro Arohtar is offline Registered User
    Name: César Silgo
    Organization: University of Extremadura
    Project: DomoUEX
    Join Date
    Nov 2006
    Posts
    5

    ICE-E in MFC connection refused

    I´m working with Ice-E to build a PocketPC server using VS 2005.

    I create the server as usual:

    Ice::CommunicatorPtr communicator;
    Ice::ObjectAdapterPtr adapter;
    try
    {
    int argc = 0;
    Ice::PropertiesPtr properties = Ice::createProperties();
    properties->setProperty("CClie.Endpoints", "tcp -p 20000");
    communicator = Ice::initializeWithProperties(argc, 0, properties);
    adapter = communicator->createObjectAdapter("CClie");
    Ice::ObjectPtr servant = new clienteI(dlg.getVideoDlg());
    adapter->add(servant, Ice::stringToIdentity("cclie"));
    adapter->activate();
    }
    catch(const Ice::Exception& ex)
    {
    AfxMessageBox(CString(ex.toString().c_str()), MB_OK|MB_ICONEXCLAMATION);
    return FALSE;
    }

    But, when I try to access from client I've got a WSACONNECTIONREFUSED exception.

    I have a Win32 version of this server and it works fine so the client-side code it´s ok.
    Last edited by Maestro Arohtar; 06-02-2007 at 05:35 AM.

  2. #2
    matthew's Avatar
    matthew is offline ZeroC Staff
    Name: Matthew Newhook
    Organization: ZeroC, Inc.
    Project: Internet Communications Engine
    Join Date
    Feb 2003
    Location
    NL, Canada
    Posts
    1,458
    You should enable network tracing in your server & client to find out what endpoints you are listening on in the server, and what endpoints your client is attempting to connect with. Please see the Ice manual for details on how to do this.

  3. #3
    marc's Avatar
    marc is offline ZeroC Staff
    Name: Marc Laukien
    Organization: ZeroC, Inc.
    Project: The Internet Communications Engine
    Join Date
    Feb 2003
    Location
    Florida
    Posts
    1,860
    Have a look at this FAQ.

  4. #4
    Maestro Arohtar is offline Registered User
    Name: César Silgo
    Organization: University of Extremadura
    Project: DomoUEX
    Join Date
    Nov 2006
    Posts
    5
    Everything it's ok but it doesn´t work.

    I´m using Virtual Machine Network Services with Microsoft Device Emulator. Is there any incompatibility or something?

    This is the client-side code:

    int argc = 0;
    Ice::InitializationData initData;
    std::string prx, propname, proxyprop;
    Cliente::CCliePrx proxy;
    Ice::CommunicatorPtr communicator;
    Ice::ObjectPrx obj;

    prx = "cclie:tcp -p 20000 -h 192.168.2.67"
    initData.properties = Ice::createProperties();
    initData.properties->setProperty("CClie.Proxy",prx);
    communicator = Ice::initialize(argc, 0, initData);

    propname = "CClie.Proxy";
    proxyprop = communicator->getProperties()->getProperty(propname);
    obj = communicator->stringToProxy(proxyprop);
    proxy = Cliente::CCliePrx::checkedCast(obj);

    proxy->camDeleted(index);

    communicator->destroy();

    Thanks for your help!!!

  5. #5
    marc's Avatar
    marc is offline ZeroC Staff
    Name: Marc Laukien
    Organization: ZeroC, Inc.
    Project: The Internet Communications Engine
    Join Date
    Feb 2003
    Location
    Florida
    Posts
    1,860
    Please set the properties Ice.Trace.Network=3 and Ice.Trace.Protocol=1 for both the client and the server, and post both logs here. Without the logs, it's impossible to tell what's going on.

  6. #6
    Maestro Arohtar is offline Registered User
    Name: César Silgo
    Organization: University of Extremadura
    Project: DomoUEX
    Join Date
    Nov 2006
    Posts
    5
    Ok, I've added a logger to each part.

    Client log (Win32):

    [ Network: trying to establish tcp connection to 192.168.2.67:20000 ]
    [ Network: trying to establish tcp connection to 192.168.2.67:20000 ]

    Server log (PocketPC) seems to fail:

    trace

    Maybe I'm doing something wrong initializing the communicator

    Thanks for your help!!!!

    P.D: I´m using the LogI class provided in the Ice-E demos

  7. #7
    matthew's Avatar
    matthew is offline ZeroC Staff
    Name: Matthew Newhook
    Organization: ZeroC, Inc.
    Project: Internet Communications Engine
    Join Date
    Feb 2003
    Location
    NL, Canada
    Posts
    1,458
    There are a number of things you can check. Firstly, you can use a debugger to ensure that the various log methods are being called (although it seems likely this is the case given the above debugger window).

    The LogI class posts WM_USER messages to the handle provided in setHandle. Did you call this method? And are you handling the WM_USER message?

  8. #8
    Maestro Arohtar is offline Registered User
    Name: César Silgo
    Organization: University of Extremadura
    Project: DomoUEX
    Join Date
    Nov 2006
    Posts
    5
    You were right wise people!!!

    This is the server log:

    "[ Network: attempting to bind to tcp socket 127.0.0.1:20000 ]"
    "[ Network: accepting tcp connections at 127.0.0.1:20000 ]"

    So I have changed this:

    properties->setProperty("CClie.Endpoints", "tcp -p 20000");

    properties->setProperty("CClie.Endpoints", "tcp -p 20000 -h 192.168.2.67");

    As the first way takes loopback IP to accept requests.

    Now it works fine but I´m confused about this because I've always done like

    X.Endpoints=tcp -p portnumber

    Is it necessary to especify the host in Ice-E? I don´t think so...

    Anyway, thank you very much for your support and excuse me for bothering you with this.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Ice Connection Refused Exception
    By aswani in forum Help Center
    Replies: 9
    Last Post: 08-12-2009, 02:27 AM
  2. Connection refused (ICE)
    By perkunas in forum Help Center
    Replies: 4
    Last Post: 08-10-2009, 07:09 AM
  3. Connection Refused
    By susannesch in forum Help Center
    Replies: 4
    Last Post: 06-25-2009, 10:52 AM
  4. Connection Refused Exception with Redhat Linux
    By mwilson in forum Help Center
    Replies: 6
    Last Post: 07-12-2005, 12:09 PM
  5. IceBox Conection refused
    By xdm in forum Help Center
    Replies: 5
    Last Post: 12-11-2003, 01:19 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •