if -p [port] is given for the client, you get [port]+10 -> change this to that you get what you set (if available)

This commit is contained in:
Volker Fischer 2020-05-07 18:19:12 +02:00
parent 15d38baae9
commit 07a92fb2c2

View File

@ -65,11 +65,9 @@ void CSocket::Init ( const quint16 iPortNumber )
}
else
{
// Per definition use the port number plus ten for the client to make
// it possible to run server and client on the same computer. If the
// port is not available, try "NUM_SOCKET_PORTS_TO_TRY" times with
// incremented port numbers.
quint16 iClientPortIncrement = 10; // start value: port nubmer plus ten
// if the port is not available, try "NUM_SOCKET_PORTS_TO_TRY" times
// with incremented port numbers
quint16 iClientPortIncrement = 0;
bSuccess = false; // initialization for while loop
while ( !bSuccess && ( iClientPortIncrement <= NUM_SOCKET_PORTS_TO_TRY ) )