common_application_impl_(const mainop &main_op,
                          signal_binder &sb,
                          application::context &context,
                          boost::system::error_code& ec)
     : application_impl(context)
     , main_(main_op)
 {
     sb.start();
 }
 common_application_impl_(const main_singleton &main,
                          signal_binder &sb,
                          singularity<application::context> &context,
                          boost::system::error_code& ec)
    : application_impl(singleton, context.get_global())
    , main_singleton_(main)
 {
    sb.start();
 }
 common_application_impl_(const main_parameter &main,
                          signal_binder &sb,
                          application::context &context,
                          boost::system::error_code& ec)
    : application_impl(parameter, context)
    , main_parameter_(main)
 {
    sb.start();
 }
 server_application_impl_(const main_singleton &main,
                          signal_binder &sb,
                          singularity<application::context> &context,
                          boost::system::error_code& ec)
    : application_impl(singleton, context.get_global())
    , main_singleton_(main)
 {
    process_id_ = daemonize(ec);
    sb.start(); // need be started after daemonize
 }
 server_application_impl_(const main_parameter &main,
                          signal_binder &sb,
                          application::context &context,
                          boost::system::error_code& ec)
    : application_impl(parameter, context)
    , main_parameter_(main)
 {
    process_id_ = daemonize(ec);
    sb.start(); // need be started after daemonize
 }
 server_application_impl_(const mainop &main_op, signal_binder &sb,
    application::context &context, boost::system::error_code& ec)
    : application_impl(context)
    , main_(main_op)
    , launch_thread_(0)
    , result_code_(0)
    , terminate_event_(0)
    , terminate_code_(0)
 {
    sb.start();
    initialize(ec);
 }
      server_application_impl_(const mainop &main, signal_binder &sb,
                               application::context &context, boost::system::error_code& ec)
         : application_impl(context)
         , main_(main)
      {
         // ver 1
#if defined( USE_DAEMONIZE_VER_1 )
         process_id_ = daemonize(ec);
#else        
         if(daemon(0, 0, ec) < 0)
         {
            ec = last_error_code();
            return;
         }
         
         process_id_ = getpid();
#endif
         
         sb.start(); // need be started after daemonize
      }