[omniORB] Re: Consistent IOR revisited
Sai-Lai Lo
S.Lo@uk.research.att.com
31 Aug 1999 21:56:24 +0100
>>>>> Robert Schumann writes:
> Hi All!
> I have been searching the archives and found just scattered information
> about this, but I believe this is so fundamental to OmniORB development, and
> I consider myself just an ordinary programmer, so tell me, please, _anyone_,
> _in simple terms_, and hopefully with code snippets:
>>>>>>> How to make my server use the same IOR every time it runs, so I can
> send this IOR to all my clients. <<<<<<<
The way to do this is described in the user guide, perhaps not that easy to
find at first glance.
Anyway, the code fragment looks something like this:
class Echo_i : public virtual _sk_Echo {
public:
Echo_i(const omniORB::objectKey& key) : _sk_Echo(key) {}
...
};
As you can see, one ctor of _sk_Echo takes an argument which will be used
as the key of the object. The key can either be generated using
the function omniORB::generateNewKey or obtain from an object
implementation using the _key member function. The omniORB::objectKey is an
opaque type but there are some functions that help you to externalise the
key into a sequence of octet (see section 4.4 of the user guide).
You also have to specify the ORB to reuse the same TCP/IP port every time.
This is done by the -BOAiiop_port <port number> option.
Sai-Lai
--
Sai-Lai Lo S.Lo@uk.research.att.com
AT&T Laboratories Cambridge WWW: http://www.uk.research.att.com
24a Trumpington Street Tel: +44 1223 343000
Cambridge CB2 1QA Fax: +44 1223 313542
ENGLAND