sstrigler/JSJaC — pull request #35 by rraptorr (2012-06-18 17:29:42+00:00)
Title: Improve error handling on WebSocket connections

Currently, if there is some problem with a WebSocket connection, the
WebSocket object is not cleaned. This can cause onerror or onclose
WebSocket event to be called some time later. If JSJaC events are not
cleaned, this can cause unexpected results on a web application using
it.
Fix this by removing all event handlers and closing WebSocket
connection in case of any error.