Loading src/Client.cpp +4 −3 Original line number Diff line number Diff line Loading @@ -2,7 +2,6 @@ #include <boost/lexical_cast.hpp> #include <boost/bind.hpp> #include <stdexcept> namespace MetadataImporter_ns { Loading Loading @@ -37,9 +36,11 @@ Client::~Client() m_ioService.stop(); m_work_sp.reset(); if(m_thread_sp) { m_thread_sp->interrupt(); //m_thread_sp->interrupt(); m_thread_sp->join(); } Loading Loading @@ -76,7 +77,7 @@ void Client::stop() if(m_thread_sp) { m_thread_sp->interrupt(); //m_thread_sp->interrupt(); m_thread_sp->join(); } Loading src/Client.h +3 −0 Original line number Diff line number Diff line Loading @@ -168,6 +168,9 @@ protected: //Tango status property std::string m_status; //Address and port of remote endpoint std::string remoteEndpoint; }; } //End of namespace Loading src/DBManager.cpp +7 −1 Original line number Diff line number Diff line Loading @@ -56,7 +56,6 @@ void DBManager::connect() throw(soci::soci_error) #ifdef VERBOSE_DEBUG INFO_STREAM << "CONNECTION: " << connection.str() << endl; INFO_STREAM << "-------------------------------------------------" << endl; #endif m_session_sp->open(soci::mysql, connection.str()); Loading Loading @@ -96,6 +95,13 @@ DBManager::InformationList DBManager::retrieveInformation(std::string schema, std::copy(rows.begin(), rows.end(), std::back_inserter(informationList)); if(informationList.empty()) { std::stringstream errorStream; errorStream << schema << "." << table << " not exists"; throw soci::soci_error(errorStream.str()); } return informationList; } Loading src/PlainClient.cpp +16 −10 Original line number Diff line number Diff line #include <PlainClient.h> #include <boost/lexical_cast.hpp> #include <boost/bind.hpp> #include <sstream> namespace MetadataImporter_ns { Loading Loading @@ -103,10 +103,13 @@ void PlainClient::handleConnect(const boost::system::error_code& errorCode, if(!errorCode) { remoteEndpoint = boost::lexical_cast<std::string>( m_plainSocket.remote_endpoint()); std::stringstream infoStream; infoStream << "Connected to " << m_plainSocket.remote_endpoint(); infoStream << "Connected to " << remoteEndpoint; INFO_STREAM << "PlainClient::handleConnect() " << infoStream.str() << endl; INFO_STREAM << "PlainClient::handleConnect() " << remoteEndpoint << endl; writeStatus(infoStream.str()); Loading Loading @@ -141,8 +144,7 @@ void PlainClient::startWriteRequest() #ifdef VERBOSE_DEBUG INFO_STREAM << "PlainClient::startRequest() " << m_plainSocket.remote_endpoint() << " <<<< " << bodySize << " byte" << endl; << remoteEndpoint << " <<<< " << bodySize << " byte" << endl; #endif std::vector<boost::uint8_t> writeBuff; Loading Loading @@ -199,8 +201,7 @@ void PlainClient::startReadResponseBody(boost::uint32_t bodySize) #ifdef VERBOSE_DEBUG INFO_STREAM << "PlainClient::startReadResponseBody() " << m_plainSocket.remote_endpoint() << " >>>> " << bodySize << " byte" << endl; << remoteEndpoint << " >>>> " << bodySize << " byte" << endl; #endif m_readBuff.resize(HEADER_SIZE + bodySize); Loading @@ -220,8 +221,13 @@ void PlainClient::closeConnection() { DEBUG_STREAM << "PlainClient::closeConnection()" << endl; std::stringstream infoStream; infoStream << "Disconnected from " << remoteEndpoint; INFO_STREAM << "PlainClient::closeConnection() " << infoStream.str() << endl; writeState(Tango::OFF); writeStatus("Disconnected"); writeStatus(infoStream.str()); boost::system::error_code errorCode; Loading src/SSLClient.cpp +16 −9 Original line number Diff line number Diff line #include <SSLClient.h> #include <boost/filesystem.hpp> #include <boost/lexical_cast.hpp> #include <boost/bind.hpp> namespace MetadataImporter_ns { Loading Loading @@ -160,8 +161,11 @@ void SSLClient::handleHandShake(const boost::system::error_code& errorCode) if(!errorCode) { remoteEndpoint = boost::lexical_cast<std::string>( m_sSLSocket.lowest_layer().remote_endpoint()); std::stringstream infoStream; infoStream << "Connected to " << m_sSLSocket.lowest_layer().remote_endpoint(); infoStream << "Connected to " << remoteEndpoint; INFO_STREAM << "SSLClient::handleHandShake() " << infoStream.str() << endl; Loading Loading @@ -193,8 +197,7 @@ void SSLClient::startWriteRequest() #ifdef VERBOSE_DEBUG INFO_STREAM << "SSLClient::startWriteRequest() " << m_sSLSocket.lowest_layer().remote_endpoint() << " <<<< " << bodySize << " byte" << endl; << remoteEndpoint << " <<<< " << bodySize << " byte" << endl; #endif std::vector<boost::uint8_t> writeBuff; Loading Loading @@ -251,8 +254,7 @@ void SSLClient::startReadResponseBody(boost::uint32_t bodySize) #ifdef VERBOSE_DEBUG INFO_STREAM << "SSLClient::startReadResponseBody() " << m_sSLSocket.lowest_layer().remote_endpoint() << " >>>> " << bodySize << " byte" << endl; << remoteEndpoint << " >>>> " << bodySize << " byte" << endl; #endif m_readBuff.resize(HEADER_SIZE + bodySize); Loading @@ -272,8 +274,13 @@ void SSLClient::closeConnection() { DEBUG_STREAM << "SSLClient::closeConnection()" << endl; std::stringstream infoStream; infoStream << "Disconnected from " << remoteEndpoint; INFO_STREAM << "SSLClient::closeConnection() " << infoStream.str() << endl; writeState(Tango::OFF); writeStatus("Disconnected"); writeStatus(infoStream.str()); boost::system::error_code errorCode; Loading Loading
src/Client.cpp +4 −3 Original line number Diff line number Diff line Loading @@ -2,7 +2,6 @@ #include <boost/lexical_cast.hpp> #include <boost/bind.hpp> #include <stdexcept> namespace MetadataImporter_ns { Loading Loading @@ -37,9 +36,11 @@ Client::~Client() m_ioService.stop(); m_work_sp.reset(); if(m_thread_sp) { m_thread_sp->interrupt(); //m_thread_sp->interrupt(); m_thread_sp->join(); } Loading Loading @@ -76,7 +77,7 @@ void Client::stop() if(m_thread_sp) { m_thread_sp->interrupt(); //m_thread_sp->interrupt(); m_thread_sp->join(); } Loading
src/Client.h +3 −0 Original line number Diff line number Diff line Loading @@ -168,6 +168,9 @@ protected: //Tango status property std::string m_status; //Address and port of remote endpoint std::string remoteEndpoint; }; } //End of namespace Loading
src/DBManager.cpp +7 −1 Original line number Diff line number Diff line Loading @@ -56,7 +56,6 @@ void DBManager::connect() throw(soci::soci_error) #ifdef VERBOSE_DEBUG INFO_STREAM << "CONNECTION: " << connection.str() << endl; INFO_STREAM << "-------------------------------------------------" << endl; #endif m_session_sp->open(soci::mysql, connection.str()); Loading Loading @@ -96,6 +95,13 @@ DBManager::InformationList DBManager::retrieveInformation(std::string schema, std::copy(rows.begin(), rows.end(), std::back_inserter(informationList)); if(informationList.empty()) { std::stringstream errorStream; errorStream << schema << "." << table << " not exists"; throw soci::soci_error(errorStream.str()); } return informationList; } Loading
src/PlainClient.cpp +16 −10 Original line number Diff line number Diff line #include <PlainClient.h> #include <boost/lexical_cast.hpp> #include <boost/bind.hpp> #include <sstream> namespace MetadataImporter_ns { Loading Loading @@ -103,10 +103,13 @@ void PlainClient::handleConnect(const boost::system::error_code& errorCode, if(!errorCode) { remoteEndpoint = boost::lexical_cast<std::string>( m_plainSocket.remote_endpoint()); std::stringstream infoStream; infoStream << "Connected to " << m_plainSocket.remote_endpoint(); infoStream << "Connected to " << remoteEndpoint; INFO_STREAM << "PlainClient::handleConnect() " << infoStream.str() << endl; INFO_STREAM << "PlainClient::handleConnect() " << remoteEndpoint << endl; writeStatus(infoStream.str()); Loading Loading @@ -141,8 +144,7 @@ void PlainClient::startWriteRequest() #ifdef VERBOSE_DEBUG INFO_STREAM << "PlainClient::startRequest() " << m_plainSocket.remote_endpoint() << " <<<< " << bodySize << " byte" << endl; << remoteEndpoint << " <<<< " << bodySize << " byte" << endl; #endif std::vector<boost::uint8_t> writeBuff; Loading Loading @@ -199,8 +201,7 @@ void PlainClient::startReadResponseBody(boost::uint32_t bodySize) #ifdef VERBOSE_DEBUG INFO_STREAM << "PlainClient::startReadResponseBody() " << m_plainSocket.remote_endpoint() << " >>>> " << bodySize << " byte" << endl; << remoteEndpoint << " >>>> " << bodySize << " byte" << endl; #endif m_readBuff.resize(HEADER_SIZE + bodySize); Loading @@ -220,8 +221,13 @@ void PlainClient::closeConnection() { DEBUG_STREAM << "PlainClient::closeConnection()" << endl; std::stringstream infoStream; infoStream << "Disconnected from " << remoteEndpoint; INFO_STREAM << "PlainClient::closeConnection() " << infoStream.str() << endl; writeState(Tango::OFF); writeStatus("Disconnected"); writeStatus(infoStream.str()); boost::system::error_code errorCode; Loading
src/SSLClient.cpp +16 −9 Original line number Diff line number Diff line #include <SSLClient.h> #include <boost/filesystem.hpp> #include <boost/lexical_cast.hpp> #include <boost/bind.hpp> namespace MetadataImporter_ns { Loading Loading @@ -160,8 +161,11 @@ void SSLClient::handleHandShake(const boost::system::error_code& errorCode) if(!errorCode) { remoteEndpoint = boost::lexical_cast<std::string>( m_sSLSocket.lowest_layer().remote_endpoint()); std::stringstream infoStream; infoStream << "Connected to " << m_sSLSocket.lowest_layer().remote_endpoint(); infoStream << "Connected to " << remoteEndpoint; INFO_STREAM << "SSLClient::handleHandShake() " << infoStream.str() << endl; Loading Loading @@ -193,8 +197,7 @@ void SSLClient::startWriteRequest() #ifdef VERBOSE_DEBUG INFO_STREAM << "SSLClient::startWriteRequest() " << m_sSLSocket.lowest_layer().remote_endpoint() << " <<<< " << bodySize << " byte" << endl; << remoteEndpoint << " <<<< " << bodySize << " byte" << endl; #endif std::vector<boost::uint8_t> writeBuff; Loading Loading @@ -251,8 +254,7 @@ void SSLClient::startReadResponseBody(boost::uint32_t bodySize) #ifdef VERBOSE_DEBUG INFO_STREAM << "SSLClient::startReadResponseBody() " << m_sSLSocket.lowest_layer().remote_endpoint() << " >>>> " << bodySize << " byte" << endl; << remoteEndpoint << " >>>> " << bodySize << " byte" << endl; #endif m_readBuff.resize(HEADER_SIZE + bodySize); Loading @@ -272,8 +274,13 @@ void SSLClient::closeConnection() { DEBUG_STREAM << "SSLClient::closeConnection()" << endl; std::stringstream infoStream; infoStream << "Disconnected from " << remoteEndpoint; INFO_STREAM << "SSLClient::closeConnection() " << infoStream.str() << endl; writeState(Tango::OFF); writeStatus("Disconnected"); writeStatus(infoStream.str()); boost::system::error_code errorCode; Loading