获得Socket连接的信息
2016-01-15 09:50:06 访问(1802) 赞(0) 踩(0)
/// <summary>
/// 获得Socket连接的信息
/// </summary>
/// <param name="s"></param>
/// <returns></returns>
public string SocketInfoGet(Socket s)
{
if (s == null)
return "";
IPEndPoint ipEndPoint = (IPEndPoint)s.RemoteEndPoint;
string address = ipEndPoint.Address.ToString();
string port = ipEndPoint.Port.ToString();
return address + ":" + port;
}
标签:
获得Socket连接的信息 


上一条:
下一条:
相关评论
发表评论