[jsb-websocket]sometimes onerror doesn't call on connect to invalid url.


#1

here is my test code,and all the url is invalid:

(new WebSocket(myurl)).onerror = function(evt){cc.log("err");};

case 1: myurl is "ws://erererererere.com",onerrorworks.
case 2: myurl is "ws://erererererere",onerror*doesn't* work.
case 3: myurl is "ws://127.0.0.1",onerror*doesn't* work.
case 4: myurl is "ws://localhost",onerror*doesn't* work.

I step the code and I found:

in case 1,WebSocket::onSocketCallback is called for reasons:
LWS_CALLBACK_PROTOCOL_INIT(21)
LWS_CALLBACK_ADD_POLL_FD(23)
LWS_CALLBACK_CLIENT_CONFIRM_EXTENSION_SUPPORTED(20)
LWS_CALLBACK_CLIENT_APPEND_HANDSHAKE_HEADER(18)
LWS_CALLBACK_DEL_POLL_FD(24)
LWS_CALLBACK_PROTOCOL_DESTROY(22)

in case 2 and 3,WebSocket::onSocketCallback is called for reasons:
LWS_CALLBACK_PROTOCOL_INIT(21)
there is not any more callback.(WHY!?)

Apprecicate if someone tell me why?