middleware_asio_server::middleware_asio_server( std::vector<boost::function<bool(const char*, uint32_t)> >& aicallbackarr ) { if (m_mser == nullptr) { /** 错误 */ return; } uint32_t lpthreadnum; m_mser->pop(lpthreadnum, "pthread_num"); middleware::socket_asio_arg larg(lpthreadnum, aicallbackarr); //larg.m_activ = false; m_mser->pop(larg.m_activ, "activ"); //larg.m_extern_activ = false; m_mser->pop(larg.m_extern_activ, "extern_activ"); // larg.m_everyoncemaxsize = 1024; m_mser->pop(larg.m_everyoncemaxsize, "everyoncemaxsize"); //larg.m_extern_everyoncemaxsize = 1024; m_mser->pop(larg.m_extern_everyoncemaxsize, "extern_everyoncemaxsize"); //larg.m_extern_loopbuffermaxsize = 10240; m_mser->pop(larg.m_extern_loopbuffermaxsize, "extern_loopbuffermaxsize"); //larg.m_loopbuffermaxsize = 10240; m_mser->pop(larg.m_extern_loopbuffermaxsize, "loopbuffermaxsize"); //larg.m_heartbeat_num = 32; m_mser->pop(larg.m_heartbeat_num, "heartbeat_num"); //larg.m_persecond_recvdatatbyte_num = 1024; m_mser->pop(larg.m_persecond_recvdatatbyte_num, "persecond_recvdatatbyte_num"); //larg.m_port = 13140; m_mser->pop(larg.m_port, "port"); //larg.m_recvpack_maxsize = 1024; m_mser->pop(larg.m_recvpack_maxsize, "recvpack_maxsize"); //larg.m_timeout = 10240; m_mser->pop(larg.m_timeout, "timeout"); //larg.m_s2c = true; m_mser->pop(larg.m_s2c, "s2c"); //larg.m_s2s = true; m_mser->pop(larg.m_s2s, "s2s"); //larg.m_session_num = 10240; m_mser->pop(larg.m_session_num, "session_num"); delete m_mser; m_mser = nullptr; /** 初始化 */ socket_asio_server_mgt::init(larg); m_send = larg.m_middlewarearr; socket_asio_server_mgt::start(); }
bool IsArgumentSecure(const std::string &arg) { std::string larg(arg); std::transform(larg.begin(), larg.end(), larg.begin(), ::tolower); int ii = 0; while (szInsecureArgumentOptions[ii] != NULL) { if (larg.find(szInsecureArgumentOptions[ii]) != std::string::npos) return false; ii++; } return true; }
bool TestCmdlineParser::TestParams::interpreteParameters () { bool toR = Process_params::interpreteParameters (); if (toR) { kstr (parameters_->getParameter ("TESTSECT", "KSTR")); kbool (parameters_->getBoolean ("TESTSECT", "KBOOL")); kint (parameters_->getInteger ("TESTSECT", "KINT")); farg (parameters_->getParameter (volatile_section_name, "farg")); oarg (parameters_->getParameter (volatile_section_name, "oarg")); rargs (parameters_->getParameter (volatile_section_name, "rarg")); larg (parameters_->getParameter (volatile_section_name, "larg")); } return toR; }