specific client to specific server object
Gary D. Duzan
gdd0@gte.com
Mon, 09 Mar 1998 16:06:21 -0500
In Message <3504274E.E440086A@iopen.com> ,
Tom Gardner <tomg@iopen.com> wrote:
=>hello all:
=>
=>I would like to have many implementations
=>of the same interface within the same
=>server ... each running within it's own thread.
=>Easy enough.
=>
=>When a client gets connected to one of these
=>objects, I would like each subsequent
=>invocation the client makes on the object
=>to be channeled to the same implementation object.
=>
=>Is there an easy way to do this with omniORB?
Your best bet is probably to have a single "registration" interface
that your clients use for their initial connection. That interface can
create a new implementation object, register it with the BOA, and
return its object reference to the client. The client is then the only
holder of the object reference, so any access to the implementation
object will be from that client. This is not a secure solution, of
course, since anyone sniffing the network could grab the reference or
the client could give it to someone else, but it is probably good
enough for many cases. There is also the issue of cleaning up the
implementation object when the client dies unexpectedly. You don't want
to leak implementation objects all over the place, but you don't want
to cut off client connections just because the network is a little
slow. A simple implementation would have the client pass an object
reference with a "ping" interface to the server, which can use it to
determine if the client is still alive, possibly retrying a few times
before killing the session.
Gary Duzan
GTE Laboratories