dnbowen
July 20th, 2002, 05:56 PM
I have an application that I am converting from Java, and one of the things that the application must do is to read the port number for a socket (client or server). I have been all through the documentation for Socket and TcpListener, but I cannot find a property or method that will give me the port number. The specific Java code I am trying to implement in C# is:
if ( null != this.client_Socket )
{
iPort = this.client_Socket.getPort();
}
else if ( null != this.server_Socket )
{
iPort = this.server_Socket.getLocalPort();
}
Does anyone know how I can get the port numbers?
if ( null != this.client_Socket )
{
iPort = this.client_Socket.getPort();
}
else if ( null != this.server_Socket )
{
iPort = this.server_Socket.getLocalPort();
}
Does anyone know how I can get the port numbers?