views:

290

answers:

1

I am trying to get a Client IP address & port for an internal collection. I found this answer. However, this seems like a lot more than what I need to simply grab the client's IP address & port. Are there any other ways to do this?

+1  A: 

There is little reason to assume that it should be easy. Remoting works over TCP, HTTP and IPC channels. The transport mechanisms are abstracted away so they don't get in the way of using Remoting. For a TCP channel, the actual socket is managed by the TcpClientSocketHandler and TcpServerSocketHandler classes. They are internal sealed classes in the .NET framework, you can't get to them from your own code.

The code in the linked post looks okay to me, it is a direct copy of the framework code. I'd recommend you try it.

Hans Passant
dboarman