[omniORB] Message source

Richard Hardgrave richard.hardgrave@teradyne.com
Thu, 18 Apr 2002 19:27:43 -0500 (CDT)


>>>>> Duncan Grisby writes:

>> On Friday 23 March, SaE wrote:
>>> how to find out client IP on server side ?

>> You can't. The CORBA standard doesn't specify a way to do it, and
>> omniORB doesn't have a proprietary extension for it.

If you just want to decide, based on the client IP address, whether to
accept or decline a connection request from the client, you can use the
gatekeeper interface inside omniORB. See the user guide for details.

On the otherhand, if your design requires you to determine the client IP
address inside the implementation of an operation, you can use the
gatekeeper interface to extract the client IP address from the socket
(using getpeername()), put the info into a per-thread storage and
extract
the value in your implementation. You either use the pthread "key" or
the
equivalent in Win32 thread API to access the per-thread storage. With
Win32, you must clean up the storage after use or there will be a memory
leak.

(Credits to Sai-Lai Lo)

Regards,

Richard

> From owner-omniorb-list@uk.research.att.com Thu Apr 18 18:47 CDT 2002
> From: "David Bellette" <david.bellette@nec.com.au>
> 
> Hi
> 
> 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?
> 
> I can't see how this is done and the only way I can think of is
> if I put some form of session id in in function call.
> 
> Surely, there is a better way. Any ideas welcome.
> 
> Thanks
> 
> David
> 
> 
> 
>