summaryrefslogtreecommitdiff
path: root/src/net/ea/network.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2014-01-14 01:08:04 +0300
committerAndrei Karas <akaras@inbox.ru>2014-01-14 01:08:04 +0300
commitc169dbdd1fc14f66890dcb6fba7ecf543067875d (patch)
treed39bf9211d34f13a2c0f2953dc1896c563f31bd1 /src/net/ea/network.cpp
parent8e4f4e04ca61594e3dec31bad70eaf6cdf86ad8f (diff)
downloadmanaverse-c169dbdd1fc14f66890dcb6fba7ecf543067875d.tar.gz
manaverse-c169dbdd1fc14f66890dcb6fba7ecf543067875d.tar.bz2
manaverse-c169dbdd1fc14f66890dcb6fba7ecf543067875d.tar.xz
manaverse-c169dbdd1fc14f66890dcb6fba7ecf543067875d.zip
Use thread safe logging in threads.
Diffstat (limited to 'src/net/ea/network.cpp')
-rw-r--r--src/net/ea/network.cpp16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/net/ea/network.cpp b/src/net/ea/network.cpp
index 4ca79b87e..c5ed9de57 100644
--- a/src/net/ea/network.cpp
+++ b/src/net/ea/network.cpp
@@ -201,10 +201,10 @@ bool Network::realConnect()
_("Unable to resolve host \"")).append(
mServer.hostname).append("\".");
setError(errorMessage);
- logger->log("TcpNet::ResolveHost: %s", errorMessage.c_str());
+ logger->log_r("TcpNet::ResolveHost: %s", errorMessage.c_str());
return false;
}
- logger->log("using alt host name: %s", mServer.althostname.c_str());
+ logger->log_r("using alt host name: %s", mServer.althostname.c_str());
}
mState = CONNECTING;
@@ -212,12 +212,12 @@ bool Network::realConnect()
mSocket = TcpNet::open(&ipAddress);
if (!mSocket)
{
- logger->log("Error in TcpNet::open(): %s", TcpNet::getError());
+ logger->log_r("Error in TcpNet::open(): %s", TcpNet::getError());
setError(TcpNet::getError());
return false;
}
- logger->log("Network::Started session with %s:%i",
+ logger->log_r("Network::Started session with %s:%i",
ipToString(ipAddress.host), ipAddress.port);
mState = CONNECTED;
@@ -248,7 +248,7 @@ void Network::receive()
switch (numReady)
{
case -1:
- logger->log1("Error: TcpNet::checkSockets");
+ logger->log_r("Error: TcpNet::checkSockets");
break;
// FALLTHROUGH
case 0:
@@ -272,7 +272,7 @@ void Network::receive()
{
// We got disconnected
mState = IDLE;
- logger->log1("Disconnected.");
+ logger->log_r("Disconnected.");
}
else if (ret < 0)
{
@@ -315,14 +315,14 @@ void Network::receive()
}
if (TcpNet::delSocket(set, mSocket) == -1)
- logger->log("Error in TcpNet::delSocket(): %s", TcpNet::getError());
+ logger->log_r("Error in TcpNet::delSocket(): %s", TcpNet::getError());
TcpNet::freeSocketSet(set);
}
void Network::setError(const std::string &error)
{
- logger->log("Network error: %s", error.c_str());
+ logger->log_r("Network error: %s", error.c_str());
mError = error;
mState = NET_ERROR;
}