예제 #1
0
void
ClientApp::handleClientDisconnected(const Event&, void*)
{
	LOG((CLOG_NOTE "disconnected from server"));
	if (!args().m_restartable) {
		m_events->addEvent(Event(Event::kQuit));
	}
	else if (!m_suspended) {
		scheduleClientRestart(nextRestartTimeout());
	}
	updateStatus();
}
예제 #2
0
void
ClientApp::handleClientFailed(const Event& e, void*)
{
	Client::FailInfo* info =
		static_cast<Client::FailInfo*>(e.getData());

	updateStatus(String("Failed to connect to server: ") + info->m_what);
	if (!args().m_restartable || !info->m_retry) {
		LOG((CLOG_ERR "failed to connect to server: %s", info->m_what.c_str()));
		m_events->addEvent(Event(Event::kQuit));
	}
	else {
		LOG((CLOG_WARN "failed to connect to server: %s", info->m_what.c_str()));
		if (!m_suspended) {
			scheduleClientRestart(nextRestartTimeout());
		}
	}
	delete info;
}
예제 #3
0
static
void
handleClientFailed(const CEvent& e, void*)
{
	CClient::CFailInfo* info =
		reinterpret_cast<CClient::CFailInfo*>(e.getData());

	updateStatus(CString("Failed to connect to server: ") + info->m_what);
	if (!ARG->m_restartable || !info->m_retry) {
		LOG((CLOG_ERR "failed to connect to server: %s", info->m_what));
		EVENTQUEUE->addEvent(CEvent(CEvent::kQuit));
	}
	else {
		LOG((CLOG_WARN "failed to connect to server: %s", info->m_what));
		if (!s_suspened) {
			scheduleClientRestart(nextRestartTimeout());
		}
	}
}