cc_session = new Session(io_service.get_io_service());
LOG_DEBUG(auth_logger, DBG_AUTH_START, AUTH_CONFIG_CHANNEL_CREATED);
+ // Initialize the Socket Requestor
+ isc::server_common::initSocketReqeustor(*cc_session);
// We delay starting listening to new commands/config just before we
// go into the main loop to avoid confusion due to mixture of
my_config_handler,
my_command_handler, false);
LOG_DEBUG(auth_logger, DBG_AUTH_START, AUTH_CONFIG_CHANNEL_ESTABLISHED);
- // Initialize the Socket Requestor
- isc::server_common::initSocketReqeustor(*config_session);
xfrin_session = new Session(io_service.get_io_service());
LOG_DEBUG(auth_logger, DBG_AUTH_START, AUTH_XFRIN_CHANNEL_CREATED);
LOG_DEBUG(resolver_logger, RESOLVER_DBG_INIT, RESOLVER_SERVICE_CREATED);
cc_session = new Session(io_service.get_io_service());
+ isc::server_common::initSocketReqeustor(*cc_session);
config_session = new ModuleCCSession(specfile, *cc_session,
my_config_handler,
my_command_handler);
- isc::server_common::initSocketReqeustor(*config_session);
LOG_DEBUG(resolver_logger, RESOLVER_DBG_INIT, RESOLVER_CONFIG_CHANNEL);
// FIXME: This does not belong here, but inside Boss
#include <server_common/logger.h>
#include <config/ccsession.h>
+#include <cc/session.h>
#include <cc/data.h>
#include <util/io/fd.h>
#include <util/io/fd_share.h>
}
// This implementation class for SocketRequestor uses
-// a ModuleCCSession for communication with the boss process,
+// a CC session for communication with the boss process,
// and fd_share to read out the socket(s).
// Since we only use a reference to the session, it must never
// be closed during the lifetime of this class
class SocketRequestorCCSession : public SocketRequestor {
public:
- explicit SocketRequestorCCSession(config::ModuleCCSession& session) :
+ explicit SocketRequestorCCSession(cc::AbstractSession& session) :
session_(session)
{
// We need to filter SIGPIPE to prevent it from happening in
share_mode, share_name);
// Send it to boss
- const int seq = session_.groupSendMsg(request_msg, "Boss");
+ const int seq = session_.group_sendmsg(request_msg, "Boss");
// Get the answer from the boss.
// Just do a blocking read, we can't really do much anyway
isc::data::ConstElementPtr env, recv_msg;
- if (!session_.groupRecvMsg(env, recv_msg, false, seq)) {
+ if (!session_.group_recvmsg(env, recv_msg, false, seq)) {
isc_throw(isc::config::CCSessionError,
"Incomplete response when requesting socket");
}
createReleaseSocketMessage(token);
// Send it to boss
- const int seq = session_.groupSendMsg(release_msg, "Boss");
+ const int seq = session_.group_sendmsg(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
isc::data::ConstElementPtr env, recv_msg;
- if (!session_.groupRecvMsg(env, recv_msg, false, seq)) {
+ if (!session_.group_recvmsg(env, recv_msg, false, seq)) {
isc_throw(isc::config::CCSessionError,
"Incomplete response when sending drop socket command");
}
}
}
- config::ModuleCCSession& session_;
+ cc::AbstractSession& session_;
std::map<std::string, int> fd_share_sockets_;
};
}
void
-initSocketReqeustor(config::ModuleCCSession& session) {
+initSocketReqeustor(cc::AbstractSession& session) {
if (requestor != NULL) {
isc_throw(InvalidOperation,
"The socket requestor was already initialized");
public:
SocketRequestorTest() : session(ElementPtr(new ListElement),
ElementPtr(new ListElement),
- ElementPtr(new ListElement)),
- specfile(std::string(TEST_DATA_PATH) +
- "/spec.spec")
+ ElementPtr(new ListElement))
{
- session.getMessages()->add(createAnswer());
- cc_session.reset(new ModuleCCSession(specfile, session, NULL, NULL,
- false, false));
- initSocketReqeustor(*cc_session);
+ initSocketReqeustor(session);
}
~SocketRequestorTest() {
}
isc::cc::FakeSession session;
- boost::scoped_ptr<ModuleCCSession> cc_session;
const std::string specfile;
};