In a VB6 Application, I am looking for a way to determine the Local Port for the duplex socket.
I have the remote Ip and Port, but I need to know an print out the local port as well.
In a VB6 Application, I am looking for a way to determine the Local Port for the duplex socket.
I have the remote Ip and Port, but I need to know an print out the local port as well.
Just query the Winsock control's LocalPort property.
The LocalPort property is used both to set the send/listen port and to retrieve it once the connection has been established. Even if you specify port 0, in which case the control will select a random port, after a connection is established, this property will contain that port number.