Commit ef3594c5 authored by JINMEI Tatuya's avatar JINMEI Tatuya
Browse files

make it at least compile


git-svn-id: svn://bind10.isc.org/svn/bind10/branches/f2f200910@273 e5f2f494-b856-4b98-b285-d166d9295462
parent 73ad8938
......@@ -28,23 +28,29 @@
using namespace std;
CommandSession::CommandSession() : session_(ISC::CC::Session()) {
CommandSession::CommandSession() :
session_(ISC::CC::Session())
{
try {
session_.establish();
session_.subscribe("ParkingLot");
session_.subscribe("Boss");
} catch (...) {
throw std::runtime_error("CommandSession: failed to open sessions");
throw std::runtime_error("SessionManager: failed to open sessions");
}
}
int
CommandSession::getSocket()
{
return (session_.getSocket());
}
std::pair<std::string, std::string>
CommandSession::getCommand() {
ISC::Data::ElementPtr cmd, routing, data, ep;
string s;
session.subscribe("statistics");
session_.group_recvmsg(routing, data, false);
cmd = data->get("command");
......@@ -61,6 +67,7 @@ CommandSession::getCommand() {
return std::pair<string, string>("unknown", "");
}
#ifdef samplecode
void
handleStatRequest()
{
......@@ -78,3 +85,4 @@ handleStatRequest()
session.group_sendmsg(resp, "statistics");
}
}
#endif
// Copyright (C) 2009 Internet Systems Consortium, Inc. ("ISC")
//
// Permission to use, copy, modify, and/or distribute this software for any
// purpose with or without fee is hereby granted, provided that the above
// copyright notice and this permission notice appear in all copies.
//
// THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
// REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
// AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
// INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
// LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
// OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
// PERFORMANCE OF THIS SOFTWARE.
// $Id$
#ifndef __CCSESSION_H
#define __CCSESSION_H 1
#include <string>
#include <cc/cpp/session.h>
class CommandSession {
public:
CommandSession();
int getSocket();
std::pair<std::string, std::string> getCommand();
private:
ISC::CC::Session session_;
};
#endif // __CCSESSION_H
// Local Variables:
// mode: c++
// End:
Markdown is supported
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