Skip to content
Snippets Groups Projects
Commit c9f0e55c authored by Valerio Pastore's avatar Valerio Pastore
Browse files

.

parent 7b79f3df
No related branches found
No related tags found
No related merge requests found
......@@ -152,8 +152,9 @@ void TCPProtocol::setHost(std::string host) {
setPort(port);
} else {
time_t now = time(nullptr);
std::cerr << "[" << std::put_time(localtime(&now), "%Y-%m-%d %H:%M:%S") <<"]\t[TCP Receiver]\t" << "invalid IP address and port format: "
<< host << std::endl;
std::cerr << "[" << std::put_time(localtime(&now), "%Y-%m-%d %H:%M:%S")
<< "]\t[TCP Receiver]\t"
<< "invalid IP address and port format: " << host << std::endl;
}
}
......@@ -163,7 +164,8 @@ void TCPProtocol::setIp(std::string ip) {
bool ok = true;
if (!std::regex_match(ip, pattern)) {
time_t now = time(nullptr);
std::cerr << "[" << std::put_time(localtime(&now), "%Y-%m-%d %H:%M:%S") <<"]\t[TCP Receiver]\t"<< "invalid IP address: " << ip
std::cerr << "[" << std::put_time(localtime(&now), "%Y-%m-%d %H:%M:%S")
<< "]\t[TCP Receiver]\t" << "invalid IP address: " << ip
<< ", setting to localhost" << std::endl;
ok = false;
this->ip = std::string("localhost");
......@@ -178,7 +180,8 @@ void TCPProtocol::setPort(int port) {
this->port = port;
else {
time_t now = time(nullptr);
std::cerr << "[" << std::put_time(localtime(&now), "%Y-%m-%d %H:%M:%S") <<"]\t[TCP Receiver]\t" << "invalid port: " << port
std::cerr << "[" << std::put_time(localtime(&now), "%Y-%m-%d %H:%M:%S")
<< "]\t[TCP Receiver]\t" << "invalid port: " << port
<< ", setting to 9003" << std::endl;
this->port = 9003;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment