gimite / web-socket-js

HTML5 Web Socket implementation powered by Flash
BSD 3-Clause "New" or "Revised" License
2.73k stars 489 forks source link

Long delay before connecting with flash socket #120

Closed jrobinson01 closed 12 years ago

jrobinson01 commented 12 years ago

I've been trying to figure out why this occurs for ages but haven't found an answer as of yet. In IE and older versions of FF, the flash socket is used. I'm loading the policy file manually from a different port than the one I'm connecting to. The policy is served via 5229, while the socket connects to 5222. There is a 3-5 second delay between the time the page loads, and the socket telling me it's connected. Does anyone know what's going on in that time? I've tried sniffing the packets and don't see it trying port 843 or any other nonsense. It just takes forever to get connected. Any help would be great!

gimite commented 12 years ago

It should first try to connect port 843, because policy file on port 843 precedes one in other port. So the start up should be faster if you provide policy file on port 843. It needs to download the SWF file, so it takes some time anyway, especially when the network is narrow.