Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

possible to use more then 65535 ports for Xmpp PubSub or Comet implementation?

In Comet/Reverse Ajax/PubSub underlying technology/fundamental is Long polling. So connection is kept open for a minute or so..
And as per my little knowledge about networking and OS, TCP/IP supports only 65535 ports, so my question is how any server can support more then 65535 connections concurrently?

In application I am building, All users are going to connect at same time, and wants live updates from server.. like stock treading realtime updates..

Cheers,

like image 892
Nachiket Avatar asked Jan 19 '26 06:01

Nachiket


1 Answers

You are correct in that there are 65535 unique port numbers, but a TCP server application allows many clients to connect to the same port on a server. For example, in a web server all clients connect to port 80. Connections are uniquely identified by the 4-tuple (src-address, src-port, dest-address, dest-port).

You will definitely want to read about the so-called C10K problem when designing your implementation.

like image 84
Greg Hewgill Avatar answered Jan 21 '26 00:01

Greg Hewgill