Esempio n. 1
0
void ClientNetworking::HandleException(const boost::system::system_error& error) {
    if (error.code() == boost::asio::error::eof) {
        DebugLogger() << "Client connection disconnected by EOF from server.";
        m_socket.close();
    }
    else if (error.code() == boost::asio::error::connection_reset)
        DebugLogger() << "Client connection disconnected, due to connection reset from server.";
    else if (error.code() == boost::asio::error::operation_aborted)
        DebugLogger() << "Client connection closed by client.";
    else {
        ErrorLogger() << "ClientNetworking::NetworkingThread() : Networking thread will be terminated "
                      << "due to unhandled exception error #" << error.code().value() << " \""
                      << error.code().message() << "\"";
    }
}
Esempio n. 2
0
 void 
 TCPConnection::ReportError(ErrorManager::eSeverity sev, int code, const String &context, const String &message, const boost::system::system_error &error)
 {
    String formattedMessage;
    formattedMessage.Format(_T("%s Remote IP: %s, Error code: %d, Message: %s"), message.c_str(), SafeGetIPAddress().c_str(), error.code().value(), String(error.what()).c_str());
    ErrorManager::Instance()->ReportError(sev, code, context, formattedMessage);         
 }