Go Back   ZeroC Forums > Help Center

Reply
 
LinkBack Thread Tools Rate Thread Display Modes
  #1 (permalink)  
Old 11-01-2004
Jennie Jennie is offline
Registered User
 
 
Join Date: Oct 2004
Posts: 13
Adding an Object to Adapter

Hello again,

I am attempting to modify the Ice/Hello demo to work with an IcePack registry and have servers be able to talk to clients across the network via tcp. So far I have been able to do that, but I would like to be able to run more than one server per adapter (there is currently one adapter per node). In other words, how do I add another object to the ASM for an object adapter?

I have tried creating a slightly modified server/client of hello, but have hit upon a stumbling block code-wise: how do I get a pointer to the local adapter (assuming it has been created) with a previous instance of the hello server. I am still using the createObjectAdapter(...) for the first one. I have gone through the includes and the documentation, but I cannot seem to find how to get that information from the communicator passed as an argument to the Hello object. For simplicity, here is the basic layout of what I have working now:

Host A:
IceRegistry (tcp only)
Ice/Hello server on Hello adapter
Ice/Hello client on Hello1 adapter (talks to Host B)

Host B:
Ice/Hello server on Hello1 adapter
Ice/Hello client on Hello adapter

What I'd like to add is another Hello client-server pair, client on one host, server on another without having to add another adapter. Thank you for all of your help.

Jennie
Reply With Quote
  #2 (permalink)  
Old 11-01-2004
michi's Avatar
michi michi is offline
ZeroC Staff
 
Name: Michi Henning
Organization: ZeroC
Project: Ice
 
Join Date: Feb 2003
Location: Brisbane, Australia
Posts: 912
You can simply remember the adapter proxy that is returned from createObjectAdapter and pass that proxy around or store it in a member variable.

Alternatively, within the context of an executing operation within the server, you can look at the Current object which contains the adapter that was used to dispatch the request (see section 20.5 in the doc).

Cheers,

Michi.
Reply With Quote
  #3 (permalink)  
Old 11-01-2004
mes's Avatar
mes mes is online now
ZeroC Staff
 
Name: Mark Spruiell
Organization: ZeroC, Inc.
Project: Ice Developer
 
Join Date: Feb 2003
Location: California
Posts: 971
Jennie,

With respect to IcePack, there is a one-to-one relationship between adapters and servers, therefore you cannot have an adapter with the same id created by more than one server.

Take care,
- Mark
Reply With Quote
  #4 (permalink)  
Old 11-02-2004
Jennie Jennie is offline
Registered User
 
 
Join Date: Oct 2004
Posts: 13
Thank You

Mark and Michi,

Thank you, that clears up my question.

Jennie
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
object adapter question mwilson Help Center 2 11-17-2006 09:28 PM
Replicated Object Adapter vsonnathi Help Center 3 04-13-2005 04:30 PM
Querying the Object Adapter endpoints aroan Help Center 6 12-27-2004 01:46 PM
how to get an object adapter from the communicator paulling Help Center 1 11-26-2003 01:29 AM
How does the object adapter work? catalin Help Center 0 10-29-2003 10:13 AM


All times are GMT -4. The time now is 05:45 PM.


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