Improve log message for server socket

pull/50/merge
Tatsuhiro Tsujikawa 2013-02-25 22:29:46 +09:00
parent dfac717dbf
commit 33037982dc
4 changed files with 7 additions and 7 deletions

View File

@ -82,10 +82,10 @@ bool DHTConnectionImpl::bind(uint16_t& port, const std::string& addr)
std::pair<std::string, uint16_t> svaddr;
socket_->getAddrInfo(svaddr);
port = svaddr.second;
A2_LOG_NOTICE(fmt(_("IPv%d DHT: listening to port %u"), ipv, port));
A2_LOG_NOTICE(fmt(_("IPv%d DHT: listening on UDP port %u"), ipv, port));
return true;
} catch(RecoverableException& e) {
A2_LOG_ERROR_EX(fmt("IPv%d DHT: failed to bind port %u", ipv, port), e);
A2_LOG_ERROR_EX(fmt("IPv%d DHT: failed to bind UDP port %u", ipv, port), e);
}
return false;
}

View File

@ -122,7 +122,7 @@ void DHTSetup::setup
e->getOption()->get(family == AF_INET?PREF_DHT_LISTEN_ADDR:
PREF_DHT_LISTEN_ADDR6);
if(!connection->bind(port, addr, sgl)) {
throw DL_ABORT_EX("Error occurred while binding port for DHT");
throw DL_ABORT_EX("Error occurred while binding UDP port for DHT");
}
localNode->setPort(port);
}

View File

@ -109,10 +109,10 @@ bool HttpListenCommand::bindPort(uint16_t port)
A2_LOG_INFO(fmt(MSG_LISTENING_PORT,
getCuid(), port));
e_->addSocketForReadCheck(serverSocket_, this);
A2_LOG_NOTICE(fmt(_("IPv%d RPC: listening to port %u"), ipv, port));
A2_LOG_NOTICE(fmt(_("IPv%d RPC: listening on TCP port %u"), ipv, port));
return true;
} catch(RecoverableException& e) {
A2_LOG_ERROR_EX(fmt("IPv%d RPC: failed to bind port %u", ipv, port), e);
A2_LOG_ERROR_EX(fmt("IPv%d RPC: failed to bind TCP port %u", ipv, port), e);
serverSocket_->closeConnection();
}
return false;

View File

@ -79,11 +79,11 @@ bool PeerListenCommand::bindPort(uint16_t& port, SegList<int>& sgl)
try {
socket_->bind(0, port, family_);
socket_->beginListen();
A2_LOG_NOTICE(fmt(_("IPv%d BitTorrent: listening to port %u"),
A2_LOG_NOTICE(fmt(_("IPv%d BitTorrent: listening on TCP port %u"),
ipv, port));
return true;
} catch(RecoverableException& ex) {
A2_LOG_ERROR_EX(fmt("IPv%d BitTorrent: failed to bind port %u",
A2_LOG_ERROR_EX(fmt("IPv%d BitTorrent: failed to bind TCP port %u",
ipv, port), ex);
socket_->closeConnection();
}