Home Help Center

Glacier Starter not support in Windows?

yomiyomi Member ✭✭
Even acted as a starter's client on windows is not support now?
I failed to use starter on windows.

Comments

  • mesmes CaliforniaAdministrators, ZeroC Staff Mark SpruiellOrganization: ZeroC, Inc.Project: Ice Developer ZeroC Staff
    Hi,

    Glacier Starter is supported on Windows as of Ice 1.3.0.

    If you are having trouble, you need to provide as much information as possible about the problem, such as your configuration settings, the command line parameters, and the error messages.

    Take care,
    - Mark
  • yomiyomi Member ✭✭
    Hi, here is my client's code.
    It runs correctly in Linux(On the same machine with server). But throw Exception on windows when excute to "GameSessionPrx base = GameSessionPrx::checkedCast(session);"

    here is the output information

    [ Network: tcp connection established
    local address = 172.16.65.182:4378
    remote address = 172.16.65.192:3700 ]
    [ Network: tcp connection established
    local address = 172.16.65.182:4381
    remote address = 172.16.65.192:3710 ]
    .\Network.cpp:489: Ice::ConnectFailedException:
    connect failed: WSAECONNREFUSED


    code start: most of them copy from demo/glacier/session
    =============================================
    void CContactor::Starter()
    {
    try
    {
    int argc = 0;
    char** argv = 0;
    Ice::PropertiesPtr properties = Ice::createProperties(argc, argv);
    properties->load("client-session-config");
    _communicator = Ice::initializeWithProperties(argc, argv, properties);
    _status = staterrun(0, 0, _communicator);
    }
    catch(const Ice::Exception& ex)
    {
    cerr << ex << endl;
    }
    catch(...)
    {
    cerr<<"unknow error " << endl;
    }
    }

    int CContactor::staterrun(int argc, char* argv[], const Ice::CommunicatorPtr& communicator)
    {
    Ice::PropertiesPtr properties = communicator->getProperties();
    const char* glacierStarterEndpintsProperty = "Glacier.Starter.Endpoints";
    string glacierStarterEndpoints = properties->getProperty(glacierStarterEndpintsProperty);
    assert(!glacierStarterEndpoints.empty());
    Ice::ObjectPrx starterBase =
    communicator->stringToProxy("Glacier/starter:" + glacierStarterEndpoints);
    Glacier::StarterPrx stater = Glacier::StarterPrx::checkedCast(starterBase);

    if (!stater)
    {
    cerr << "endpoints " << glacierStarterEndpoints
    << "do not refer to a glacier router starter" << endl;
    }

    Ice::ByteSeq privateKey;
    Ice::ByteSeq publicKey;
    Ice::ByteSeq routerCert;

    try
    {
    _router = stater->startRouter(_Id, _Pwd, privateKey, publicKey, routerCert);
    }
    catch(const Glacier::CannotStartRouterException& ex)
    {
    cerr << ":" << ex << ":\n" << ex.reason << endl;
    }
    catch(const Glacier::PermissionDeniedException&)
    {
    cout << "password invalid, login permision denied" << endl;
    }

    Ice::PluginManagerPtr pluginManager = communicator->getPluginManager();
    Ice::PluginPtr plugin = pluginManager->getPlugin("IceSSL");
    IceSSL::PluginPtr sslPlugin = IceSSL::PluginPtr::dynamicCast(plugin);
    assert(sslPlugin);

    sslPlugin->configure(IceSSL::Client);
    sslPlugin->addTrustedCertificate(IceSSL::Client, routerCert);
    sslPlugin->setCertificateVerifier(IceSSL::Client, sslPlugin->getSingleCertVerifier(routerCert));

    sslPlugin->setRSAKeys(IceSSL::Client, privateKey, publicKey);

    communicator->setDefaultRouter(_router);

    Glacier::SessionPrx session = _router->createSession();
    GameSessionPrx base = GameSessionPrx::checkedCast(session);

    _session =
    GameSessionPrx::checkedCast(base->ice_twoway()->ice_timeout(-1)->ice_secure(false));


    if (!_session)
    {
    cerr << "invalid object reference" << endl;
    return EXIT_FAILURE;
    }
    return 0;
    }

    =============================================

    client configure
    =============================================
    Ice.Warn.Connections=1
    Ice.Trace.Network=1
    #Ice.Trace.Protocol=1

    Ice.Plugin.IceSSL=IceSSL:create
    IceSSL.Client.CertPath=D:/Ice-1.3.0/certs
    IceSSL.Client.Config=sslconfig.xml
    IceSSL.Server.CertPath=D:/Ice-1.3.0/certs
    IceSSL.Server.Config=sslconfig.xml
    #IceSSL.Trace.Security=1

    Glacier.Starter.Endpoints=tcp -h 172.16.65.192 -p 3700:ssl -h 172.16.65.192 -p 3701
    Glacier.Starter.PropertiesOverride=Ice.ServerIdleTime=60
  • mesmes CaliforniaAdministrators, ZeroC Staff Mark SpruiellOrganization: ZeroC, Inc.Project: Ice Developer ZeroC Staff
    Does the Glacier/session demo work correctly for you on Windows? If so, I suggest you compare your configuration settings against those from the demo to see if there are any significant differences that might explain the failure.

    If the Glacier/session demo does not work correctly, please provide the console output from the client, starter and server.

    Thanks,
    - Mark
  • yomiyomi Member ✭✭
    HelloSessionManager.Endpoints=tcp -p 10000:udp -p 10000:ssl -p 10001

    Ice.Warn.Connections=1
    Ice.Trace.Network=1
    #Ice.Trace.Protocol=1

    Glacier session demo also failed.

    config
    =======================================

    Ice.Plugin.IceSSL=IceSSL:create
    IceSSL.Client.CertPath=../../../certs
    IceSSL.Client.Config=sslconfig.xml
    IceSSL.Server.CertPath=../../../certs
    IceSSL.Server.Config=sslconfig.xml
    #IceSSL.Trace.Security=1

    Glacier.Router.Endpoints=default
    Glacier.Router.SessionManager=HelloSessionManager:tcp -h 172.16.65.192 -p 10000:ssl -h 172.16.65.192 -p 10001
    Glacier.Router.Client.Endpoints=tcp:udp:ssl
    Glacier.Router.Trace.Client=2
    Glacier.Router.Trace.RoutingTable=1

    Glacier.Starter.PermissionsVerifier=PermissionsVerifier:tcp -h 172.16.65.192 -p 10000:ssl -h 172.16.65.192 -p 10001
    Glacier.Starter.AddUserToAllowCategories=1
    Glacier.Starter.Endpoints=tcp -h 172.16.65.192 -p 11000:ssl -h 172.16.65.192 -p 11001
    Glacier.Starter.PropertiesOverride=Ice.ServerIdleTime=60

    ======================================
    Out put:

    [ Network: tcp connection established
    local address = 172.16.65.182:1424
    remote address = 172.16.65.192:11000 ]
    user id: yomi
    password: yomi
    client: Glacier::CannotStartRouterException:
    got EOF from `glacierrouter'
    [ Network: closing tcp connection
    local address = 172.16.65.182:1424
    remote address = 172.16.65.192:11000 ]


    I change
    Glacier.Router.Endpoints=tcp -h 172.16.65.192 -p 3700

    out put:

    [ Network: tcp connection established
    local address = 172.16.65.182:1427
    remote address = 172.16.65.192:11000 ]
    user id: yomi
    password: yomi
    [ Network: tcp connection established
    local address = 172.16.65.182:1430
    remote address = 172.16.65.192:3700 ]
    .\Network.cpp:489: Ice::ConnectFailedException:
    connect failed: WSAECONNREFUSED
    [ Network: closing tcp connection
    local address = 172.16.65.182:1430
    remote address = 172.16.65.192:3700 ]
    [ Network: closing tcp connection
    local address = 172.16.65.182:1427
    remote address = 172.16.65.192:11000 ]


    seems better. but still error.
    I am wondered why there are 3 connections?
    one is connection with starter.
    the other is connection with router.
    what is the third one?
  • mesmes CaliforniaAdministrators, ZeroC Staff Mark SpruiellOrganization: ZeroC, Inc.Project: Ice Developer ZeroC Staff
    Ok, I believe I know what's going wrong now. From the error message in your post ("got EOF from ..."), it's clear that you are running GlacierStarter on Linux. The demo's configuration file is written assuming that the client, server and GlacierStarter are all running on the same host. If you want to run GlacierStarter and the server on a different host from the client, then you must make sure that all your endpoints are using a host address that is accessible to the client.

    The easiest way to do this without modifying the configuration file on Linux is to run the server and GlacierStarter with the option

    --Ice.Default.Host=172.16.65.192

    The only property you need to change in the client's configuration file is Glacier.Starter.Endpoints.

    Let us know if you're still having trouble.

    Take care,
    - Mark
Sign In or Register to comment.