]> git.proxmox.com Git - mirror_novnc.git/commit
web-socket-js (issue #37): close() when connecting
authorJoel Martin <github@martintribe.org>
Sat, 11 Sep 2010 18:52:49 +0000 (13:52 -0500)
committerJoel Martin <github@martintribe.org>
Sat, 11 Sep 2010 18:52:49 +0000 (13:52 -0500)
commitac7bdbc22fd9a0f150479321ebe7e01f8d448a74
treed3e5e54027996bf09f8f95dbb61b2d5852ff8bde
parent071f2818a8182d88040f5acba3b8e54dc644ef4e
web-socket-js (issue #37): close() when connecting

Filed this issue for this bug:
http://github.com/gimite/web-socket-js/issues/issue/37

Right now the close() call only calls __flash.close() if readyState is OPEN.
But it should really call close any time that readyState is not CLOSED or
CLOSING.

The case I ran into is when I want to do the following:
1. make a test connection
2. tell the server to setup for a connection
3. connect again

I call close on the test connection, but since it is ignored when CONNECTING,
it eventually times out with a error. But by that time I have already issued a
new connection, it causes the new connection to fail. close() should cancel
CONNECTING state too.
include/web-socket-js/web_socket.js