Just want to add a note.. actually there doesn't seem to have any way to detect if a connection couldnt be established. If we fellow the draft from dev.w3.org/html5/websockets there are return codes. 1006 should be the returned code for such closure.. however the plugin doesn't allow for getting this value.
This should do the job.. (rest of code not shown.. but easy to figure out)
this.ws.onclose = function (evt_) {
self.code = evt_.code;
self.runtime.trigger(cr.plugins_.C2WebSocket.prototype.cnds.OnClosed, self);
};
Also i think i fixed the bug... _err must not be used directly. _err.data must be used. This is still an event like any other event of websockets.
I worked a lots with websockets so i hope ive helped a bit! <img src="smileys/smiley1.gif" border="0" align="middle" />