Beispiel #1
0
		scgi(cppcms::service &srv) :
			connection(srv),
			start_(0),
			end_(0),
			socket_(srv.impl().get_io_service())
		{
		}
Beispiel #2
0
	stock(cppcms::service &srv) : cppcms::application(srv),timer_(srv.get_io_service())
	{
		dispatcher().assign("^/price$",&stock::get,this);
		dispatcher().assign("^/update$",&stock::update,this);
		price_=10.3;
		counter_=0;
		async_run();
	}
Beispiel #3
0
 chat(cppcms::service &srv) : 
     cppcms::application(srv)
 {
     queue_ = sse::bounded_event_queue::create(srv.get_io_service(),1024);
     queue_->enable_keep_alive(10);
     dispatcher().assign("/post",&chat::post,this);
     dispatcher().assign("/get",&chat::get,this);
     dispatcher().assign(".*",&chat::redirect,this);
 }
Beispiel #4
0
rpc::rpc(cppcms::service& srv, Database& db, Processor& p)
    : cppcms::rpc::json_rpc_server(srv), db(db), p(p),
      timer(srv.get_io_service()), exiting(false),
      statusThread(StatusThread(*this, exiting))
{
    // Account
    bind("account_login", cppcms::rpc::json_method(&rpc::account_login, this), method_role);
    bind("account_logout", cppcms::rpc::json_method(&rpc::account_logout, this), method_role);
    bind("account_create", cppcms::rpc::json_method(&rpc::account_create, this), method_role);
    bind("account_update", cppcms::rpc::json_method(&rpc::account_update, this), method_role);
    bind("account_delete", cppcms::rpc::json_method(&rpc::account_delete, this), method_role);

    // Forms
    bind("form_process", cppcms::rpc::json_method(&rpc::form_process, this), method_role);
    bind("form_getone", cppcms::rpc::json_method(&rpc::form_getone, this), method_role);
    bind("form_getall", cppcms::rpc::json_method(&rpc::form_getall, this), method_role);
    bind("form_delete", cppcms::rpc::json_method(&rpc::form_delete, this), method_role);
    bind("form_rename", cppcms::rpc::json_method(&rpc::form_rename, this), method_role);

    // Timeouts for getting rid of long requests
    on_timer(booster::system::error_code());
}