The description of the limits of TCP connections on your server is kind of wrong.
The book says:
If you look at the TCP packet format, you’ll see that a port number is 16 bits long. It can only go up to 65535. Different OSs use different port ranges for ephemeral sockets, but the IANA recommended range is 49152 to 65535. That gives your server the ability to have at most 16,383 connections open. But your machine is probably dedicated to your service rather than handling, say, user logins. So we can stretch that range to ports 1024–65535, for a maximum of 64,511 connections.
Now I’ll tell you that some servers are handling more than a million concurrent
connections. Some people are pushing toward ten million connections on a
If there are only 64,511 ports available for connections, how can a server have a million connections? The secret is virtual IP addresses. The operating system binds additional IP addresses to the same network interface. Each IP address has its own range of port numbers, so we would need a total of 16 IP addresses to handle that many connections.
This TCP information is sort of correct, but the implication is wrong. Those limits apply to the number of server processes that can LISTEN for connections. However those processes can accept lots of connections from different source IP Address/Port combinations. So a single process could handle thousands of connections on a single port. This is how all web servers work. The server listens on port 80, and accepts a request from my IP address with port like 43567. While processing my request it can also accept another connection from YOUR IP Address with whatever port number your web browser connected out from.
So having LOTs of listening processes might need virtual IP addresses, but having a single application accept lots of connections only needs one IP Address and one listening port.