VOID CNetManager::WaitPacket(VOID) { if(!m_Socket.isValid()) { if (connect_state_ == 1) { if (show_ == true) { show_ = false; const char* szString = DICTIONARY_CONFIG_MGR::instance()->get_string_by_id(SERVER_DISCONNECT); UI_ModalDialogue_Layer::DoModal("",szString,UI_ModalDialogue_Layer::DT_OK,[]() { Account_Logic::releaseData(); #if (CC_TARGET_PLATFORM == CC_PLATFORM_WP8) || (CC_TARGET_PLATFORM == CC_PLATFORM_WINRT) MessageBox("You pressed the close button. Windows Store Apps do not implement a close button.","Alert"); return; #endif Director::getInstance()->end(); #if (CC_TARGET_PLATFORM == CC_PLATFORM_IOS) exit(0); #endif } ); //UI_ModalDialogue_Layer::DoModal("",szString,UI_ModalDialogue_Layer::DT_OK,Account_Logic::releaseData); } } return; } //网络数据流操作 if(!Select() || !ProcessExcept() || !ProcessInput() || !ProcessOutput()) { //CEventSystem::GetMe()->PushEvent(GE_NET_CLOSE); } /* int s=Select() ; CCLog("--------------------s is %d",s); int p1=ProcessExcept(); CCLog("--------------------p1 is %d",p1); int p2=ProcessInput(); CCLog("--------------------p2 is %d",p2); int p3=ProcessOutput(); CCLog("--------------------p3 is %d",p3); */ //Packet操作 ProcessCommands( ) ; }
VOID CNetManager::WaitPacket(VOID) { if(!m_Socket.isValid()) { return; } //网络数据流操作 if(!Select() || !ProcessExcept() || !ProcessInput() || !ProcessOutput()) { CEventSystem::GetMe()->PushEvent(GE_NET_CLOSE); } //Packet操作 ProcessCommands( ) ; }