Added connection state checks [cocos2dx]