Я думаю, что это - полностью вопрос стиля. Ни у одного действительно нет очевидного преимущества перед другим.
Непротиворечивость более важна, чем любой конкретный выбор, таким образом, я рекомендовал бы, чтобы Вы собрались со своей командой и выбрали один стиль и придерживались его.
http://msdn.microsoft.com/en-us/library/system.net.sockets.socket.remoteendpoint.aspx
You can then call the IPEndPoint..::.Address method to retrieve the remote IPAddress, and the IPEndPoint..::.Port method to retrieve the remote port number.
More from the link (fixed up alot heh):
Socket s;
IPEndPoint remoteIpEndPoint = s.RemoteEndPoint as IPEndPoint;
IPEndPoint localIpEndPoint = s.LocalEndPoint as IPEndPoint;
if (remoteIpEndPoint != null)
{
// Using the RemoteEndPoint property.
Console.WriteLine("I am connected to " + remoteIpEndPoint.Address + "on port number " + remoteIpEndPoint.Port);
}
if (localIpEndPoint != null)
{
// Using the LocalEndPoint property.
Console.WriteLine("My local IpAddress is :" + localIpEndPoint.Address + "I am connected on port number " + localIpEndPoint.Port);
}
RemoteEndPoint - это свойство, его тип - System.Net.EndPoint , наследуемый от System.Net.IPEndPoint .
Если взять взглянув на членов IPEndPoint , вы увидите, что есть свойство Address
.