how could I get the port of the client that is connecting to the c开发者_运维问答# application?
Assuming you have a System.Net.Sockets.Socket
object, Type-cast its RemoteEndPoint
property to an IPEndPoint
and then read its Port
property.
To listen on a socket, don't you need to know the port number first?
精彩评论