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

Output more information for IOErrors #74

Closed 3rd-Eden closed 13 years ago

3rd-Eden commented 13 years ago

Hi,

I got a small feature request, I just noticed that I'm receiving "cannot connect to Web Socket server at .. (IoError)"'s completely random. But it doesn't state WHY that issue was occurring in the first place.

So it would be nice, if the error also outputted the error.text from the event:IOErrorEvent. Or are there better ways to debug this issue?

~ Arnout

gimite commented 13 years ago

Sorry for late. I added event.text to the error message at: https://github.com/gimite/web-socket-js/commit/840bade50b095168e49992d1f8614ec189498c12

When I tried to connect to a server which is not running, I got event.text: Error #2031: Socket error. URL: gimite.net even with debug version of Flash Player. So I'm not sure if it is useful, though.

Usually IoError just means that it cannot make TCP connection to the server port. So I guess it is because either the network or the server program is unstable.

3rd-Eden commented 13 years ago

Hi,

Thanks for adding it anyways, every tiny bit of debug information is more than welcome. Maybe we add a simple retry when you get IoError, to be sure that the connection is in fact broken before finally giving up.

3rd-Eden commented 13 years ago

@gimite totally unrelated to this issue, but noticed that your Readme still points to https://github.com/LearnBoost/Socket.IO-node/blob/master/lib/socket.io/transports/flashsocket.js which is broken because socket.io 0.7 started using a separate module for it (https://github.com/3rd-Eden/FlashPolicyFileServer)

gimite commented 13 years ago

Thanks for the information. Updated the link.