Go Back   ZeroC Forums > Help Center

Reply
 
LinkBack Thread Tools Rate Thread Display Modes
  #1 (permalink)  
Old 08-11-2006
davidcr1983 davidcr1983 is offline
Registered User
 
Name: David Vallejo Fernández
Organization: Universidad de Castilla-La Mancha
Project: basic-fipa-multiagentsystem
 
Join Date: Jul 2005
Location: Ciudad Real (Spain)
Posts: 41
Various servers behind Glacier2

Hello again!!

I am studying Glacier2 and I am testing a dummy application. I use IceGrid as locator service and with Glacier2 I stablish a connection from and external client (out of my local network).

Now, I want to include another server using IceGrid, and I know that it is not necessary to use another external connection, but I don't know how to do it. I have the following specification:

#ifndef DEMO_ICE
#define DEMO_ICE
#include <Glacier2/Session.ice>

module Demo {
interface Friend {
nonmutating void sayHello();
};
interface Printer extends Glacier2::Session {
["ami"] nonmutating string getMessage(Friend* f);
};
};

#endif

And this is my descriptor:

<icegrid>
<application name="Demo">
<node name="localhost">

<server id="Printer"
exe="./Server.py"
activation="on-demand">
<adapter name="SimplePrinterAdapter"
endpoints="tcp -h 127.0.0.1"
register-process="true">
<object identity="Printer/manager" type=":emo:Printer"/>
</adapter>
</server>

</node>
</application>
</icegrid>

If I include another interface in my Slice description, how could I access to its associated server from an external client using an unique connection with Glacier2?

My glacier2router config file is the following:

Glacier2.InstanceName=Printer
Glacier2.Client.Endpoints=tcp -h 192.168.1.5 -p 8000
Glacier2.Client.PublishedEndpoints=tcp -h ladorada.dyndns.org -p 8000
Glacier2.Server.Endpoints=tcp -h 192.168.1.5
Glacier2.SessionManager=Printer/manager
Glacier2.SessionTimeout=60
Glacier2.CryptPasswords=passwords

#Ice.Trace.Network=2
Ice.Default.Locator=IceGrid/Locator:tcp -h 127.0.0.1 -p 9090

Therefore, if I include another server behind my firewall, what value should the Glacier2.SessionManager parameter have?

I hope I have explained my problem correctly.

Thank you very much!
__________________
Full name: David Vallejo Fernández
University of Castilla-La Mancha (Spain)
ICE Project: basic-fipa-multiagentsystem
Reply With Quote
  #2 (permalink)  
Old 08-11-2006
marc's Avatar
marc marc is offline
ZeroC Staff
 
Name: Marc Laukien
Organization: ZeroC, Inc.
Project: The Internet Communications Engine
 
Join Date: Feb 2003
Location: Florida
Posts: 1,781
You don't have to change the session manager at all, i.e., there is one session manager that your client uses, independent of the number of servers your client uses. You call the second server just like the first, by invoking on a proxy pointing to an Ice object implemented by this server. What specific problems do you have?

As an aside, I highly recommend to read issue 1 and issue 2 of our Connections newsletter.

Last edited by marc : 08-11-2006 at 12:10 PM.
Reply With Quote
  #3 (permalink)  
Old 08-11-2006
davidcr1983 davidcr1983 is offline
Registered User
 
Name: David Vallejo Fernández
Organization: Universidad de Castilla-La Mancha
Project: basic-fipa-multiagentsystem
 
Join Date: Jul 2005
Location: Ciudad Real (Spain)
Posts: 41
If I append another interface:

interface NewServer extends Glacier2::Session {
nonmutating string sayGoodbye(Friend* f);
};

and I specify another server in the descriptor:

<server id="NewServer"
exe="./NewServer.py" activation="on-demand">
<adapter name="NewServerAdapter" endpoints="tcp -h 127.0.0.1"
register-process="true">
<object identity="¿¿??" type=":emo:NewServer"/>
</adapter>
</server>

How can I get an object which represents the new funcional qualities if the previous "Printer/manager" object extended from Glacier2::Session and, therefore, represents the Glacier2 connection?

It is analogous to the chat example exposed in Connections (Issue number 1), but appending another interface and using IceGrid.

Do you understand my explanations?

Thank you.
__________________
Full name: David Vallejo Fernández
University of Castilla-La Mancha (Spain)
ICE Project: basic-fipa-multiagentsystem
Reply With Quote
  #4 (permalink)  
Old 08-11-2006
bernard's Avatar
bernard bernard is offline
ZeroC Staff
 
Name: Bernard Normier
Organization: ZeroC, Inc.
Project: Ice
 
Join Date: Feb 2003
Location: Palm Beach Gardens, FL
Posts: 834
Hi David,

With Glacier2, servers are typically completely unaware of Glacier2. In particular, they don't need to implement any special interface or register any object with Glacier2.

Creating and registering a Glacier2 SessionManager is something optional that you can do to provide sessions to your *clients*. If your clients don't need Session objects, just don't implement a SessionManager.

A Glacier2 SessionManager must implement Glacier2::SessionManager, so I don't see how your first example works:
Code:
Glacier2.SessionManager=Printer/manager
(since Printer/manager is a Glacier2::Session, not a Glacier2::SessionManager)

See "Session Management" in the Glacier2 chapter of the Ice manual. For your first Glacier2 experiments, I'd recommend to skip this feature.

Cheers,
Bernard
__________________
Bernard Normier
ZeroC, Inc.
Reply With Quote
  #5 (permalink)  
Old 08-11-2006
davidcr1983 davidcr1983 is offline
Registered User
 
Name: David Vallejo Fernández
Organization: Universidad de Castilla-La Mancha
Project: basic-fipa-multiagentsystem
 
Join Date: Jul 2005
Location: Ciudad Real (Spain)
Posts: 41
Thank you for your explanations!

I had a wrong conception of Glacier2, but now I understand its operation correctly.

Thank you again,
David.
__________________
Full name: David Vallejo Fernández
University of Castilla-La Mancha (Spain)
ICE Project: basic-fipa-multiagentsystem
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
What will the clients do when the servers be killed? AaronIct Help Center 1 02-26-2007 08:15 AM
node name(s) on multiple servers angelocook Help Center 1 09-01-2006 03:01 PM
Newbie: How to search for Servers jaleira Help Center 9 06-29-2006 09:02 PM
A problem about IceGrid's replicated servers rc_hz Help Center 3 05-30-2005 10:01 AM
Ice and stateless servers zet Help Center 2 12-01-2004 04:06 AM


All times are GMT -4. The time now is 12:18 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.0.0
(c) 2008 ZeroC, Inc.