public void run() { Dbg.INFO_MSG("KBEThread::run()"); int count = 0; START_RUN: over = false; try { this.app_.process(); count = 0; } catch (Exception e) { Dbg.ERROR_MSG(e.ToString()); Dbg.INFO_MSG("KBEThread::try run:" + count); count++; if (count < 10) { goto START_RUN; } } over = true; Dbg.INFO_MSG("KBEThread::end()"); }
public void _onConnectStatus(string error) { KBEngine.Event.deregisterIn(this); bool success = (error == ""); if (success) { Dbg.INFO_MSG(string.Format("NetworkInterface::_onConnectStatus(), connected to {0}", sock().RemoteEndPoint.ToString())); _packetReceiver = new PacketReceiver(this); _packetReceiver.startRecv(); } else { Dbg.ERROR_MSG(string.Format("NetworkInterface::_onConnectStatus(), connect is error! ip: {0}:{1}, err: {2}", _connectIP, _connectPort, error)); } Event.fireAll("onConnectStatus", new object[] { success }); if (_connectCB != null) { _connectCB(_connectIP, _connectPort, success, _userData); } }