Commit 4bd9e2d2 authored by Elvin Sindrilaru's avatar Elvin Sindrilaru
Browse files

XROOTD: Fix the callback port value for asynchronous requests

This is the port on which the XRootD manager waits for connections from
the diskmanagerd daemons to get responses to the various requests that
the clients have previously submitted. This avoids the issue of binding
each time we restart the XRootD daemon to a random port and therefore
the diskmanagerd daemons avoid "Connection refused" errors on their side.
parent 8ddefd32
......@@ -49,6 +49,9 @@
XCASTORNAMESPACE_BEGIN
// Port on which the diskmanager replies with the response for a GET/PUT
unsigned short XrdxCastorClient::sCallbackPort = 35000;
//------------------------------------------------------------------------------
// Constructor
//------------------------------------------------------------------------------
......@@ -60,22 +63,6 @@ XrdxCastorClient::XrdxCastorClient():
mIsZombie(false)
{
mCallbackSocket = new castor::io::ServerSocket(true);
// Get the port range to be used
int low_port = castor::client::LOW_CLIENT_PORT_RANGE;
int high_port = castor::client::HIGH_CLIENT_PORT_RANGE;
char* sport;
if ((sport = getconfent((char*)castor::client::CLIENT_CONF,
(char*)castor::client::LOWPORT_CONF, 0)) != 0)
{
low_port = castor::System::porttoi(sport);
}
if ((sport = getconfent((char*)castor::client::CLIENT_CONF,
(char*)castor::client::HIGHPORT_CONF, 0)) != 0)
{
high_port = castor::System::porttoi(sport);
}
// Set the socket to non blocking
int rc;
......@@ -90,7 +77,7 @@ XrdxCastorClient::XrdxCastorClient():
}
// Bind the socket
mCallbackSocket->bind(low_port, high_port);
mCallbackSocket->bind(sCallbackPort, sCallbackPort);
mCallbackSocket->listen();
// Start the poller thread
......
......@@ -267,6 +267,7 @@ private:
std::string FormatTimestamp(struct timeval& tv);
static unsigned short sCallbackPort; ///< callback port for responses
castor::io::ServerSocket* mCallbackSocket; ///< callback socket
struct pollfd mFds[1024]; ///< set of file descriptors to wait on
nfds_t mNfds; ///< number of pollfs structs in the mFds array
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment