tags:

views:

260

answers:

2

Hi,

Is it possible to find out / get some information about the connecting client when using remoting on .net 2.0? I like to know get some information about the connecting client on the server side, so I can act accordingly? This is a small and very local application that Never will have more then max 10 simultaneously connecting/requesting clients.

pass client reference in each function? (or some identifier)? I could do it this way, but I would prefer to just get the information from the request/connecting client. Ip-address or similar would be nice.

Regards

+1  A: 

This question might have the answer you're looking for.

I stripped out the parts that probably don't matter to you and left the part that actually grabs the IPAddress.

public ServerProcessing ProcessMessage(IServerChannelSinkStack sinkStack, 
    IMessage requestmessage, ITransportHeaders requestHeaders, 
    System.IO.Stream requestStream, out IMessage responseMessage, 
    out ITransportHeaders responseHeaders, out System.IO.Stream responseStream)
{
    // Get the IP address and add it to the call context.
    IPAddress ipAddr = (IPAddress)requestHeaders[CommonTransportKeys.IPAddress];
}
Joseph
+2  A: 

Take a look at the answer I provided for a similar question:

Identifying the client during a .NET remoting invocation (Answer)

Kev
Thanks! It solved my problem!
anra