[omniORB] Message source
Duncan Grisby
duncan@grisby.org
Fri, 19 Apr 2002 12:07:28 +0100
On Friday 19 April, "David Bellette" wrote:
> If I have a servant with multiple client machines connected to the
> servant, what is the correct way of telling which client made a
> function call?
It's not something you're meant to do within the CORBA object model,
so there's no standard way to do it. However, you can do it with
omniORB specific means. omniORB 4 lets you do it with interceptors, so
it's better than the things Sai-Lai talked about in Richard
Hardgrave's repost.
If you look at include/omniORB4/omniInterceptors.h, you'll see the
serverReceiveRequest_T interceptor, that allows you to intercept an
incoming call. In that interceptor, you get hold of a GIOP_S
reference. You can cast that to a giopStrand reference (due to the
operator in the giopStream class from which GIOP_S is derived).
giopStrand has a virtual member function called peeraddress() that
tells you the remote address.
So the scheme in omniORB 4 is to create a thread specific data slot
using the interface in omnithread.h, then fill it in with a
serverReceiveRequest interceptor.
Cheers,
Duncan.
--
-- Duncan Grisby --
-- duncan@grisby.org --
-- http://www.grisby.org --