Server/Client limitation

Just starting out? Need help? Post your questions and find answers here.
User avatar
Jac de Lad
Enthusiast
Enthusiast
Posts: 106
Joined: Wed Jul 15, 2020 7:10 am
Contact:

Server/Client limitation

Post 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?
Thorium
Addict
Addict
Posts: 1268
Joined: Sat Aug 15, 2009 6:59 pm

Re: Server/Client limitation

Post 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.
Marc56us
Addict
Addict
Posts: 1108
Joined: Sat Feb 08, 2014 3:26 pm
Location: France

Re: Server/Client limitation

Post 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)
(English is not my native language, I use an online translator.)
User avatar
NicTheQuick
Addict
Addict
Posts: 817
Joined: Sun Jun 22, 2003 7:43 pm
Location: Germany, Saarbrücken
Contact:

Re: Server/Client limitation

Post 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.
The english grammar is freeware, you can use it freely - But it's not Open Source, i.e. you can not change it or publish it in altered way.
Thorium
Addict
Addict
Posts: 1268
Joined: Sat Aug 15, 2009 6:59 pm

Re: Server/Client limitation

Post 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.
User avatar
NicTheQuick
Addict
Addict
Posts: 817
Joined: Sun Jun 22, 2003 7:43 pm
Location: Germany, Saarbrücken
Contact:

Re: Server/Client limitation

Post 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.
The english grammar is freeware, you can use it freely - But it's not Open Source, i.e. you can not change it or publish it in altered way.
User avatar
Jac de Lad
Enthusiast
Enthusiast
Posts: 106
Joined: Wed Jul 15, 2020 7:10 am
Contact:

Re: Server/Client limitation

Post 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.
Post Reply