Results 1 to 5 of 5

Thread: IcePack and Glacier2 configuration

  1. #1
    xdm's Avatar
    xdm
    xdm is offline ZeroC Staff
    Name: Jose Gutierrez de la Concha
    Organization: ZeroC, Inc.
    Project: Ice Developer
    Join Date
    Sep 2003
    Location
    La Coruņa, Spain
    Posts
    588

    IcePack and Glacier2 configuration

    Hello

    I trying to configure Glacier2 to work with a service deployed in a icepacknode, i'm not sure if this is posible. i basicaly create a chatserice similar to the example provided with Ice sources but i create it as a IceBox::Service and activate it trow IcePack instead of running as Ice::Application

    how is the way to specific glacier2.server.endpoints to point a service in to icepack

    must the service has a fixed endpoint in the descriptor file or can it use default option ?

  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
    Quote Originally Posted by xdm
    Hello

    I trying to configure Glacier2 to work with a service deployed in a icepacknode, i'm not sure if this is posible. i basicaly create a chatserice similar to the example provided with Ice sources but i create it as a IceBox::Service and activate it trow IcePack instead of running as Ice::Application

    how is the way to specific glacier2.server.endpoints to point a service in to icepack

    must the service has a fixed endpoint in the descriptor file or can it use default option ?
    Yes, this is possible. One the future newsletter articles will show exactly how to do this. You don't need to do anything special with respect to endpoints, and you certainly don't need to run them on a fixed endpoint.

    To turn the server into an IceBox server you take the contents of the ChatSessionServer::run method and make it into an IceBox service.

    Something like this.

    Code:
    class ChatSessionServiceI : public ::IceBox::Service
    {
    public:
    
        virtual void
        start(const string& name, const CommunicatorPtr& communicator, const StringSeq& args)
        {
            _adapter = communicator->createObjectAdapter("ChatServer");
            _adapter->add(new DummyPermissionsVerifierI, Ice::stringToIdentity("verifier"));
            _adapter->add(new ChatSessionManagerI, Ice::stringToIdentity("ChatSessionManager"));
            _adapter->activate();
        }
    
        virtual void
        stop()
        {
            _adapter->deactivate();
        }
    
    private:
    
        Ice::ObjectAdapterPtr _adapter;
    };
    Then you need a deployment descriptor. Something like this:

    Code:
    <icepack>
      <variable name="icebox.exe" value="icebox"/>
      <target name="windebug">
          <variable name="icebox.exe" value="iceboxd"/>
      </target>
      <application name="ChatServer">
         <node name="node">
            <server name="ChatApplication" kind="cpp-icebox" endpoints="tcp -h 127.0.0.1" activation="on-demand">
                <service name="ChatSession" entry="ChatSessionService:create">
                    <adapters>
                        <adapter name="ChatServer" endpoints="tcp">
                            <object identity="ChatSessionManager" type="::Chat::ChatSession"/>
                            <object identity="verifier" type="::Glacier2::PermissionsVerifier"/>
                        </adapter>
                    </adapters>
                </service>
            </server>
         </node>
      </application>
    </icepack>
    Regards, Matthew

  3. #3
    xdm's Avatar
    xdm
    xdm is offline ZeroC Staff
    Name: Jose Gutierrez de la Concha
    Organization: ZeroC, Inc.
    Project: Ice Developer
    Join Date
    Sep 2003
    Location
    La Coruņa, Spain
    Posts
    588
    Quote Originally Posted by matthew
    Code:
    _adapter->add(new ChatSessionManagerI, Ice::stringToIdentity("ChatSessionManager"));
    Code:
    <adapter name="ChatServer" endpoints="tcp">
     <object identity="ChatSessionManager" type="::Chat::ChatSession"/>
      <object identity="verifier" type="::Glacier2::PermissionsVerifier"/>
    Regards, Matthew
    I don't understand why you put type="::Chat::ChatSession" and not type="::Chat::ChatSessionManager"

    I can't configure glacier2 to contact my icepack

    Code:
    glacier2router: error: service caught unhandled Ice exception:
    Network.cpp:545: Ice::ConnectionRefusedException:
    connection refused: Connection refused
    [ glacier2router: Network: accepted tcp connection
      local address = 192.168.0.3:10005
      remote address = 192.168.0.3:50121 ]
    [ glacier2router: Network: accepted tcp connection
      local address = 127.0.0.1:32785
      remote address = 127.0.0.1:47850 ]
    [ glacier2router: Network: closing tcp connection
      local address = 192.168.0.3:10005
      remote address = 192.168.0.3:50121 ]
    [ glacier2router: Network: closing tcp connection
      local address = 127.0.0.1:32785
      remote address = 127.0.0.1:47850 ]
    [ glacier2router: Network: stopping to accept tcp connections at 192.168.0.3:10005 ]
    [ glacier2router: Network: stopping to accept tcp connections at 127.0.0.1:32785 ]
    My glacier2 config file
    Code:
    Glacier2.Client.Endpoints=tcp -h 192.168.0.3 -p 10005
    Glacier2.Server.Endpoints=tcp -h 127.0.0.1
    Glacier2.SessionManager=ChatSessionManager:tcp -h 127.0.0.1 -p 10001
    Glacier2.PermissionsVerifier=verifier:tcp -h 127.0.0.1 -p 10001
    Glacier2.SessionTimeout=30
    
    Ice.Trace.Network=3
    Ice.Trace.Protocol=3
    Ice.Warn.Connections=3
    ChatService code

    Code:
    _adapter=communicator->createObjectAdapter(name);
    Ice::Identity id=Ice::stringToIdentity("ChatServer/ChatServer");	
    _adapter->add(new Oz::Chat::PermissionsVerifierI,Ice::stringToIdentity("verifier"));
    _adapter->add(new Oz::Chat::SessionManagerI,Ice::stringToIdentity("ChatSessionManager"));
    Oz::Chat::ChatServerPtr server=new Oz::Chat::ChatServerI(id);
    _adapter->add(server,id);
    _adapter->activate();
    I atacht here my icepacnode cofing files
    Attached Files Attached Files

  4. #4
    benoit's Avatar
    benoit is online now ZeroC Staff
    Name: Benoit Foucher
    Organization: ZeroC, Inc.
    Project: Ice
    Join Date
    Feb 2003
    Location
    Rennes, France
    Posts
    2,196
    If the type of the ChatSessionManager object is ::Chat::ChatSessionManager then the descriptor should indeed use ::Chat::ChatSessionManager.

    It's difficult to say exactly what could be wrong without more information. The Ice.Default.Locator configuration property is missing from your Glacier2 configuration file however, can you add it and see if this helps?

    Benoit.

  5. #5
    xdm's Avatar
    xdm
    xdm is offline ZeroC Staff
    Name: Jose Gutierrez de la Concha
    Organization: ZeroC, Inc.
    Project: Ice Developer
    Join Date
    Sep 2003
    Location
    La Coruņa, Spain
    Posts
    588

    Glacier2 + IcePack runing ok

    Hi

    thanks for your observation beniot I added the Ice.Default.Locator and put the id of receiver and sesionManager and comunication between IcePack and Glacier2 are now runing ok and i can crete a session from my client.

    expecial thanks to Matthews for the article about connection managament

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. IcePack Query and Glacier2 question
    By aerowyn in forum Help Center
    Replies: 6
    Last Post: 10-16-2005, 02:15 AM
  2. Glacier2 and IcePack
    By vsonnathi in forum Help Center
    Replies: 3
    Last Post: 04-21-2005, 10:52 AM
  3. Replies: 1
    Last Post: 04-19-2005, 03:47 AM
  4. Replies: 7
    Last Post: 02-11-2005, 02:11 PM
  5. Puzzled by IcePack/Locator and IcePack/Query
    By rc_hz in forum Help Center
    Replies: 2
    Last Post: 11-13-2004, 09:41 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
  •