mirror of https://github.com/axmolengine/axmol.git
Solve the crash in WebSocketTest when the network in disconnected.
This commit is contained in:
parent
fec04dd6ae
commit
99b2c5453e
|
@ -201,6 +201,11 @@ void WebSocketTestLayer::toExtensionsMainLayer(cocos2d::Ref *sender)
|
|||
// Menu Callbacks
|
||||
void WebSocketTestLayer::onMenuSendTextClicked(cocos2d::Ref *sender)
|
||||
{
|
||||
if (! _wsiSendText)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (_wsiSendText->getReadyState() == network::WebSocket::State::OPEN)
|
||||
{
|
||||
_sendTextStatus->setString("Send Text WS is waiting...");
|
||||
|
@ -216,6 +221,10 @@ void WebSocketTestLayer::onMenuSendTextClicked(cocos2d::Ref *sender)
|
|||
|
||||
void WebSocketTestLayer::onMenuSendBinaryClicked(cocos2d::Ref *sender)
|
||||
{
|
||||
if (! _wsiSendBinary) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (_wsiSendBinary->getReadyState() == network::WebSocket::State::OPEN)
|
||||
{
|
||||
_sendBinaryStatus->setString("Send Binary WS is waiting...");
|
||||
|
|
Loading…
Reference in New Issue