getting ip in service using tcp connection
Hi there. I'm building a small chat in which there is a main server that hosts a service, and there are many clients. Each client hosts a service too, so it can get any messages sent by other clients, through a call done by the server.
But I have a little problem. I need to know every client IP. I searched a lot, and I found it to be easier using HttpChannel, where I can just use something like:
This is great as I can do it inside the service.
string clientAddress = HttpContext.Current.Request.UserHostAddress;
But I'm using a TcpChannel as a connection.
How can I, inside of the ServerService, get the client IP?
static void Main(string args)
TcpChannel channel = new TcpChannel(8086);
System.Console.WriteLine("press <enter> to quit...");
Thanks in advance.
My best regards.