Page 1 of 1

Server/Client limitation

Posted: Mon Nov 30, 2020 3:27 pm
by Jac de Lad
Hi,
Im starting a program for my work that collects data from some computers via network. I want to use the built-in network functions. Is there a limit for connections at one time?

Re: Server/Client limitation

Posted: Mon Nov 30, 2020 3:55 pm
by Thorium
I don't think there is a hard limit for active network connections. At least not in PureBasic, the operating system may have a limit, i am not sure. If the active conncections does not go into the thousends, i would not worry.

Re: Server/Client limitation

Posted: Mon Nov 30, 2020 4:19 pm
by Marc56us
Each IP address can handle 65,535 ports.
By convention the first 1024 ports are reserved (but they can still be used).
The operating system takes care of assigning a free port for each client at connection.
Remember to close each connection after use to free the port.
It is possible that PB also has a limitation.
(For more information, see: sockets)

Re: Server/Client limitation

Posted: Mon Nov 30, 2020 4:28 pm
by NicTheQuick
Purebasic has no limit by itself. But it's quite unhandy to work with a lot of connections because you can not start each connection in its own thread.

Re: Server/Client limitation

Posted: Mon Nov 30, 2020 4:50 pm
by Thorium
Marc56us wrote:Each IP address can handle 65,535 ports.
By convention the first 1024 ports are reserved (but they can still be used).
The operating system takes care of assigning a free port for each client at connection.
Remember to close each connection after use to free the port.
It is possible that PB also has a limitation.
(For more information, see: sockets)
The 65535 limit is only for clients. A server can theoretically handle 65535 connection for each client.

Re: Server/Client limitation

Posted: Mon Nov 30, 2020 5:21 pm
by NicTheQuick
The maximum limit for a process listening on a certain port on your linux machine is the maximum limit of file descriptors the process is allowed to use.

Re: Server/Client limitation

Posted: Mon Nov 30, 2020 5:58 pm
by Jac de Lad
Ok thanks for the answers. It's about 30 to 40 machines right now, but itay be some more in the future. So I guess there shouldn't be a problem.