[omniORB] How to get file descriptor from a CORBA request?

Tuyen Chau tchau at verano.com
Mon Sep 25 12:38:26 BST 2006


Hi Sander,

Thanks for your reply.  Can you elaborate on this?  I'm interested in 
your solution.

Are you saying that the client should use a clientSendRequest 
interceptor to add a service context, and the server should use a 
serverReceiveRequest interceptor to read the context?  The part that I 
don't understand is that if I'm in a CORBA request, say,

    Account BankManager_i::openAccount(String name) {
    }

How do I get the service context to figure out which client this is?  Do 
I need to somehow store the service context somewhere in the servant 
object first when I'm in the interceptor, and then when I'm in the CORBA 
request, I'll just read the context back from the object?

Thanks in advance for any help that you can provide,
Tuyen

Sander Steffann wrote:
> Hi,
>
>> No, you can't get the file descriptor. And anyway, omniORB clients can
>> open multiple concurrent connections, and close idle connections, so the
>> file descriptor is not a useful indication of which client is which.
>> With server-side interceptors, you can access internal connection state,
>> and try to construct some idea of which client is which based on IP
>> address, but by far the simplest thing to do is for clients to identify
>> themselves in the calls.
>
> You can add/read a service context in interceptors. You can (for 
> example) put an id or username/password in there without modifying the 
> IDL of your interfaces. This is what we do in our application. For 
> security an SSL connection might be a good idea.
>
> Good luck,
> Sander.



More information about the omniORB-list mailing list