% SRVCOMM_SET_LISTEN setting addresses to listen to
Debug message, noting that the server is about to start listening on a
different set of IP addresses and ports than before.
+
+% SOCKETREQUESTOR_CREATED Socket requestor created
+Debug message. A socket requesor (client of the socket creator) is created
+for the corresponding application. Normally this should happen at most
+one time throughout the lifetime of the application.
+
+% SOCKETREQUESTOR_DESTROYED Socket requestor destoryed
+Debug message. The socket requestor created at SOCKETREQUESTOR_CREATED
+has been destroyed. This event is generally unexpected other than in
+test cases.
+
+% SOCKETREQUESTOR_GETSOCKET Received a %1 socket for [%2]:%3, FD=%4, token=%5, path=%6
+Debug message. The socket requestor for the corresponding application
+has requested a socket for a set of address, port and protocol (shown
+in the log message) and successfully got it from the creator. The
+corresponding file descriptor and the associated "token" (an internal
+ID used between the creator and requestor) are shown in the log
+message.
+
+% SOCKETREQUESTOR_RELEASESOCKET Released a socket of token %1
+Debug message. The socket requestor has released a socket passed by
+the creator. The associated token of the socket is shown in the
+log message. If the corresponding SOCKETREQUESTOR_GETSOCKET was logged
+more detailed information of the socket can be identified by matching
+the token.
#include <config.h>
#include "socket_request.h"
+#include <server_common/logger.h>
#include <config/ccsession.h>
#include <cc/data.h>
return (passed_sock_fd);
}
+namespace {
+inline const char*
+protocolString(SocketRequestor::Protocol protocol) {
+ switch (protocol) {
+ case SocketRequestor::TCP:
+ return ("TCP");
+ case SocketRequestor::UDP:
+ return ("UDP");
+ default:
+ return ("unknown protocol");
+ }
+}
+}
+
// This implementation class for SocketRequestor uses
// a ModuleCCSession for communication with the boss process,
// and fd_share to read out the socket(s).
isc_throw(Unexpected, "Failed to filter SIGPIPE: " <<
strerror(errno));
}
+ LOG_DEBUG(logger, DBGLVL_TRACE_BASIC, SOCKETREQUESTOR_CREATED);
}
~SocketRequestorCCSession() {
closeFdShareSockets();
+ LOG_DEBUG(logger, DBGLVL_TRACE_BASIC, SOCKETREQUESTOR_DESTROYED);
}
virtual SocketID requestSocket(Protocol protocol,
// and finally get the socket itself
const int passed_sock_fd = getSocketFd(token, sock_pass_fd);
+ LOG_DEBUG(logger, DBGLVL_TRACE_DETAIL, SOCKETREQUESTOR_GETSOCKET).
+ arg(protocolString(protocol)).arg(address).arg(port).
+ arg(passed_sock_fd).arg(token).arg(path);
return (SocketID(passed_sock_fd, token));
}
// Send it to boss
const int seq = session_.groupSendMsg(release_msg, "Boss");
+ LOG_DEBUG(logger, DBGLVL_TRACE_DETAIL, SOCKETREQUESTOR_RELEASESOCKET).
+ arg(token);
// Get the answer from the boss.
// Just do a blocking read, we can't really do much anyway