Changeset - 0d9c0387a457
[Not reviewed]
0 1 0
HanzZ - 13 years ago 2012-07-30 20:02:10
hanzz.k@gmail.com
Fixed race condition caused by not stopped reconnectTimer
1 file changed with 1 insertions and 0 deletions:
0 comments (0 inline, 0 general)
src/transport.cpp
Show inline comments
 
@@ -218,24 +218,25 @@ void Component::stop() {
 
// 		m_component->disconnect();
 
		m_reconnectTimer->stop();
 
	}
 
	else if (m_server) {
 
		LOG4CXX_INFO(logger, "Stopping component in server mode on port " << CONFIG_INT(m_config, "service.port"));
 
		m_server->stop();
 
	}
 
}
 

	
 
void Component::handleConnected() {
 
	onConnected();
 
	m_reconnectCount = 0;
 
	m_reconnectTimer->stop();
 
}
 

	
 
void Component::handleServerStopped(boost::optional<Swift::BoostConnectionServer::Error> e) {
 
	if(e != NULL ) {
 
		if(*e == Swift::BoostConnectionServer::Conflict)
 
			LOG4CXX_INFO(logger, "Port "<< CONFIG_INT(m_config, "service.port") << " already in use! Stopping server..");
 
		if(*e == Swift::BoostConnectionServer::UnknownError)
 
			LOG4CXX_INFO(logger, "Unknown error occured! Stopping server..");
 
		exit(1);
 
	}
 
}
 

	
0 comments (0 inline, 0 general)