服务器端accept后生成的新的socket对象中
s=新socket
// Uses the RemoteEndPoint property.
Console::Write("I am connected to ");
Console::Write(IPAddress::Parse((__try_cast<IPEndPoint *>(s->RemoteEndPoint)->Address)->ToString()));
Console::Write("on port number ");
Console::WriteLine(__box(__try_cast<IPEndPoint *>(s->RemoteEndPoint)->Port)->ToString());
// Uses the LocalEndPoint property.
Console::Write("My local IpAddress is :");
Console::Write(IPAddress::Parse((__try_cast<IPEndPoint *>(s->LocalEndPoint)->Address)->ToString()));
Console::Write("I am connected on port number ");
Console::WriteLine(__box(__try_cast<IPEndPoint *>(s->LocalEndPoint)->Port)->ToString());