Skip to content

Commit

Permalink
in case of websocket server down, open connect will false. send a err…
Browse files Browse the repository at this point in the history
…or message to js.
  • Loading branch information
u0u0 committed Sep 16, 2013
1 parent 6a3b6d4 commit 53242bd
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions extensions/network/WebSocket.cpp
Expand Up @@ -456,6 +456,12 @@ void WebSocket::onSubThreadStarted()
_wsInstance = libwebsocket_client_connect(_wsContext, _host.c_str(), _port, _SSLConnection,
_path.c_str(), _host.c_str(), _host.c_str(),
name.c_str(), -1);
if (NULL == _wsInstance) {
WsMessage *msg = new WsMessage();
msg->what = WS_MSG_TO_UITHREAD_ERROR;
_readyState = kStateClosing;
_wsHelper->sendMessageToUIThread(msg);
}
}
}

Expand Down

0 comments on commit 53242bd

Please sign in to comment.