[omniORB] client IP addres
Sai-Lai Lo
S.Lo@uk.research.att.com
26 Mar 2001 09:54:42 +0000
>>>>> 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.
Regards,
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