Page 1 of 1

WHY is GetClientPort() giving a Port different...

Posted: Sun May 12, 2013 9:51 am
by es_91
... from what I set up in CreateNetworkServer() ?

Can somebody answer to this?

Re: WHY is GetClientPort() giving a Port different...

Posted: Sun May 12, 2013 11:22 am
by Didelphodon
Because it's the port of the client side which is usually a more or less random one. The port you chose for server creation is your local port where clients can connect to.

Re: WHY is GetClientPort() giving a Port different...

Posted: Sun May 12, 2013 12:45 pm
by es_91
So there are two ports to a connection, one at the client's side and one at the server's side and PureBasic allows me only to set the one at the server's side, is that right?

Re: WHY is GetClientPort() giving a Port different...

Posted: Sun May 12, 2013 12:46 pm
by Shield
Yes, that's how TCP / UDP work. The client port doesn't mean anything, it's just used
so the server knows what port is expecting the answer.

Re: WHY is GetClientPort() giving a Port different...

Posted: Sun May 12, 2013 12:58 pm
by es_91
Thanks. :)