How to determine which server IP address the client connected to
I'm binding with IPAddress.Any. My server has multiple IP addresses. In my case all on the same NIC but I don't think that matters -- it could be just as easily multiple NIC.
I need to know which IP address the client has connected to. Is this possible, or should I create different sockets for each of my Ipaddresses and bind to each one?
开发者_如何学CUpdate: Creating a TcpListener for each of the IP Addresses as proven to be the easiest solution, although I remain open to other suggestions related to IPAddress.Any (0.0.0.0)
TcpClient.Client.LocalEndPoint
should contain the correct IP Address.
精彩评论