[omniORB] Re: corbaloc
David Riddoch
djr@uk.research.att.com
Wed, 17 Jan 2001 17:43:21 +0000 (GMT)
This message is in MIME format. The first part should be readable text,
while the remaining parts are likely unreadable without MIME-aware tools.
Send mail to mime@docserver.cac.washington.edu for more info.
---559023410-1804928587-979753401=:25994
Content-Type: TEXT/PLAIN; charset=US-ASCII
Hi Peter,
Yep, it's not too difficult. I have attached a patch to the omniORB 2.6.1
source that persuades it to accept any key <= 12 bytes long. Untested,
but it looks okay!
You will need to back port the client-side corbaloc and corbaname stuff
yourself (if you need it) -- see omniURI.cc in the omniORB 3 distribution.
Then all you need is a way to set the object key in your object
implementation in the server. The following function sets up the
omniORB::objectKey properly:
void set_corbaloc_key(omniORB::objectKey& k, const char* name)
{
int len = strlen(name);
if( len > sizeof(omniORB::objectKey) ) throw something;
memcpy(&k, name, len);
memset((char*) &k + len, 0, sizeof(omniORB::objectKey) - len);
}
And you need to pass this key down to the constructor of the skeleton
class your object implementation is derived from ... as usual for servers
with persistent keys.
Hope that works!
David
---559023410-1804928587-979753401=:25994
Content-Type: TEXT/PLAIN; charset=US-ASCII; name="omni261_corbaloc.diff"
Content-Transfer-Encoding: BASE64
Content-ID: <Pine.SO4.4.04.10101171743210.25994@onion>
Content-Description:
Content-Disposition: attachment; filename="omni261_corbaloc.diff"
ZGlmZiAtcmMgb21uaU9SQl8yLjYuMS9zcmMvbGliL29tbmlPUkIyL2dpb3BT
ZXJ2ZXIuY2MgMjYxL3NyYy9saWIvb21uaU9SQjIvZ2lvcFNlcnZlci5jYw0K
KioqIG9tbmlPUkJfMi42LjEvc3JjL2xpYi9vbW5pT1JCMi9naW9wU2VydmVy
LmNjCUZyaSBBdWcgMjEgMjA6MDg6NTEgMTk5OA0KLS0tIDI2MS9zcmMvbGli
L29tbmlPUkIyL2dpb3BTZXJ2ZXIuY2MJV2VkIEphbiAxNyAxNzoyNzowNCAy
MDAxDQoqKioqKioqKioqKioqKioNCioqKiA0NjgsNDkyICoqKioNCiAgICAg
I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