开发者

Get port of the incoming tcp connection

开发者 https://www.devze.com 2023-02-28 09:12 出处:网络
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 IPEndPo

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?

0

精彩评论

暂无评论...
验证码 换一张
取 消