Skip to content
Snippets Groups Projects
Commit 1192ae1e authored by Daniele Kruse's avatar Daniele Kruse
Browse files

added a second interface to castor::io::connectWithTimeout requiring only hostname and port

parent 704f4499
Branches
Tags
No related merge requests found
......@@ -823,11 +823,17 @@ int castor::io::connectWithTimeout(
const unsigned short port,
const int timeout)
throw(castor::exception::TimeOut, castor::exception::Exception) {
castor::exception::Internal ex;
ex.getMessage() << "connectWithTimeout() not implemented";
throw ex;
std::ostringstream portStream;
portStream << port;
struct addrinfo *result;
getAddrInfo(hostName.c_str(), portStream.str().c_str(), NULL, &result);
return connectWithTimeout(
result->ai_family,
result->ai_socktype,
result->ai_protocol,
result->ai_addr,
result->ai_addrlen,
timeout);
}
//------------------------------------------------------------------------------
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment