1

This is running against localhost, with all other transports disabled for testing.

When testing other transports on IE and other browsers, there's no such lag.

Anything that can be done about this? I've got the latest Adobe Flash installed, running Windows 7 64bit, socket.io 0.9.

Evgeniy Berezovsky
  • 18,571
  • 13
  • 82
  • 156
  • Not sure if this link might help [link]https://github.com/LearnBoost/socket.io/issues/458[/link] – Tianzhen Lin Jul 11 '12 at 04:55
  • Thanks for the link. I don't think a stack overflow would lead to a mere delay, and the bug mentioned there talks about an error. Apart from that, that bug has long been fixed (10 months ago). I edited my post to make clear I'm running a recent version of socket.io. – Evgeniy Berezovsky Jul 11 '12 at 07:18
  • Might be relevant? https://github.com/gimite/web-socket-js/issues/120 As pointed out below, IE8 is going to be using Flash sockets since you have Flash installed. – Matt Browne Feb 25 '13 at 18:49

2 Answers2

4

The problem is with how Flash policy server is working: it tries to connect to port 843 at first and obtain policy file. If there is no response within 5 seconds it tries to obtain policy file from server - and socket.io is providing this file internally. If you want to prevent such situation you can run your own flash policy server from link above - this will take you couple minutes and improve user experience significantly.

Bernard Potocki
  • 1,248
  • 8
  • 9
  • 1
    That was it! Installing https://github.com/3rd-Eden/FlashPolicyFileServer accelerated things! P.S. I had set up a bounty for this question, and I believe your answer came in time, but bounty expiry hit before I noticed your answer. Let me know if you came for the bounty. :) Then I'll setup another +50 so I can award it to you. – Evgeniy Berezovsky Mar 01 '13 at 06:33
  • 2
    There is no need for that - bounty promoted your question so I was able to see it and help you, but I'm not bounty hunter ;) – Bernard Potocki Mar 01 '13 at 13:05
  • I +1ed your comment (in addition to the answer, of course). This helps you and does not hurt me at all :) – Evgeniy Berezovsky Mar 04 '13 at 03:42
0

I think the problem is that IE 8 does not support websocket, which falls back to long polling when you try to use flashsocket. Even IE 9 does not natively support sockets. You can use IE 10 provides which native support, but it is disabled by default. Look here for which browsers support websockets

The five second wait that you are experiencing is because of the long-polling. The server holds the request until timeout or some info arrives. See the differences here socket.io - XHR polling vs flashsocket and websocket

Community
  • 1
  • 1
user568109
  • 47,225
  • 17
  • 99
  • 123
  • WebSocket does not seem to be involved here. When starting the socket.io server with these protocols `websocket,flashsocket,htmlfile`, there'll be this delay, but when starting it with `websocket,htmlfile`, there is no delay. Also, in the former case, it will use `flashsocket`, as IE8 obviously supports Flash. FlashSocket != WebSocket. – Evgeniy Berezovsky Feb 25 '13 at 02:58