tags:

views:

134

answers:

2

Hi, 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,

+4  A: 

each connection is attributed as follows:

  • source ip (could be any)
  • source port (could be any in range 1024-65535)
  • destination ip (your server ip)
  • destination port (specific port your app is running on)

so the number of connections to the server is limited by the number of all possible ips multiplied by the 64000 (roughly). no server can handle that as of yet... :)

pulegium
+5  A: 

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.

Greg Hewgill