本文整理汇总了C++中LOGT函数的典型用法代码示例。如果您正苦于以下问题:C++ LOGT函数的具体用法?C++ LOGT怎么用?C++ LOGT使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了LOGT函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: LOGT
//-----------------------------------------------------------------------------
int ContextSP::_r_send_header()
{
if(_hdr.bytes()) {
int err;
if(_hdr.is_ssl == true) {//used when http proxy is configured in browser
_sck_ssl_connect = true;
LOGT("H CONNECT accepted");
err = _sock.sendall((const u_int8_t*)HTTP_200, strlen(HTTP_200), SS_TOUT);
}
else if(_hdr._nprx != 0){
_hdr.prep_doc();
err = _rock.sendall(_hdr.buf(), _hdr.bytes(), SS_TOUT);
LOGT("H header sent: ["<<_hdr.bytes()
<<"][" << _hdr.buf() << "]\n");
}
_hdr.clear();
if(0!=err) {
_s_send_reply(GENFAILURE);
_rock.destroy();
throw Mex((REMOTE_CLOSED_ONSEND),__FILE__,__LINE__);
}
}
if(_working)
return 1;
return Context::_r_send_header();
}
示例2: testThread
void testThread()
{
char arg1[] = "th1";
char arg2[] = "th2";
Thread th1((Thread::Routine)foo, arg1);
Thread th2((Thread::Routine)foo, arg2);
th1.setBackground(true);
th1.start();
th2.start();
#ifdef _WIN32
Thread::sleep(500);
th1.suspend();
LOGT("th1 was suspended.");
Thread::sleep(500);
th2.suspend();
LOGT("th2 was suspended.");
Thread::sleep(500);
th1.resume();
LOGT("th1 was resumed.");
Thread::sleep(500);
th2.resume();
LOGT("th2 was resumed.");
#endif
int ret2 = th2.join();
LOG_VAR(ret2);
}
示例3: LOGT
void IoServiceCore::start()
{
_netThread->run();
LOGT("Create net thread [ %s ]", _netThread->getThreadId());
_logicThread->run();
LOGT("Create main logic thread [ %s ]", _logicThread->getThreadId());
}
示例4: run
void run()
{
LOGT("hello");
while (this->getExit() == false)
{
LOGT("hello");
Thread::sleep(1000);
}
}
示例5: while
void Server::start() {
while (!abortableWaitForConnection(socket, pipe[0])) {
pool.execute(socket.accept());
}
LOGT("Closed server main loop.");
LOGT("Closing worker pool...");
pool.stop();
}
示例6: LOGI
void server::handle_accept(const boost::system::error_code& e) {
if (!e) {
// handle connection
LOGI("new connection, id="<<new_connection_->connection_id());
LOGT("Handle new connection ...");
LOGT("connection reference count: "<<new_connection_.use_count());
new_connection_->start();
LOGT("connection reference count after start: "<<new_connection_.use_count());
}
// accept again
start_accept();
}
示例7: assert
int ContextSP::_parse_header()
{
if(_pending_hdr()==0)
return 0;
assert(!_sck_ssl_connect);
//const bool con = _rock.check_connection();
if(_hdr._nhost)
{
char host[512]= {0};
char port[4] = "80";
::strcpy(host, _hdr.get_host().c_str());
LOGT("H C: hdr ["<<_hdr.bytes()
<< "][" << _hdr.buf() << "]\n to: " << host);
char* pp = strchr(host,':');
if(pp) {
*pp++=0;
} else {
pp = port;
}
_raddr.port = ::atoi(pp);
_raddr.ip = sock::dnsgetip(host);
if(_raddr.ip.ipv4==0){
throw Mex(CANNOT_CONNECT,__FILE__,__LINE__);
}
if(_working )
{
if(_rip == _raddr){
LOGT("H sending hdr to:"<< IP2STR(_rip.ip) << ":" << _rip.port);
return _r_send_header();
} // else rip!=ap
return _overwrite_connection(_raddr);
}
assert(!_rock.isopen());
if(_check_acl())
{
return 0;
}
_rock.raw_sethost(_raddr.ip, htons(_raddr.port));
_rip = _raddr;
return _rock_connect();
}
if(_working)
return _r_send_header();
throw Mex(CANNOT_PARSE_HTTP,__FILE__,__LINE__);
}
示例8: LOGT
void server::start_accept() {
//>= 2^ 62
++connection_id_;
if ((connection_id_ >= 4611686018427387904) || (connection_id_ <= 0)) {
connection_id_ = 1;
}
LOGT("start_accept, connection_id="<<connection_id_);
//前一个connection不会释放吗?为什么? connection.start... 通过shared_from_this引用?
LOGT("connection reference count: "<<new_connection_.use_count());
new_connection_.reset(new connection(io_service_pool_.get_io_service(), connection_id_));
LOGT("connection reference count: "<<new_connection_.use_count());
acceptor_.async_accept(new_connection_->socket(),
boost::bind(&server::handle_accept, this, boost::asio::placeholders::error));
}
示例9: handle
virtual void handle(int v)
{
if (v > 100)
LOGT("T1 work");
else
handleNext(v);
}
示例10: OSPD_SubscribeResult
/****************************************************************************************************
* @fn OSPD_SubscribeResult
* Enables subscription for results
*
***************************************************************************************************/
osp_status_t OSPD_SubscribeResult(uint32_t sensorType, OSPD_ResultDataCallback_t dataReadyCallback ) {
osp_status_t result = OSP_STATUS_OK;
LOGT("%s\r\n", __FUNCTION__);
return result;
}
示例11: OSPD_GetVersion
/****************************************************************************************************
* @fn OSPD_GetVersion
* Helper routine for getting daemon version information
*
***************************************************************************************************/
osp_status_t OSPD_GetVersion(char* versionString, int bufSize) {
osp_status_t result = OSP_STATUS_OK;
LOGT("%s\r\n", __FUNCTION__);
return result;
}
示例12: OSPD_Deinitialize
/****************************************************************************************************
* @fn OSPD_Deinitialize
* Tear down RPC interface function
*
***************************************************************************************************/
osp_status_t OSPD_Deinitialize(void) {
osp_status_t result = OSP_STATUS_OK;
LOGT("%s\r\n", __FUNCTION__);
return result;
}
示例13: OSPD_UnsubscribeResult
/****************************************************************************************************
* @fn OSPD_UnsubscribeResult
* Unsubscribe from sensor results
*
***************************************************************************************************/
osp_status_t OSPD_UnsubscribeResult(uint32_t sensorType) {
osp_status_t result = OSP_STATUS_OK;
LOGT("%s\r\n", __FUNCTION__);
return result;
}
示例14: testTimerHandler
void testTimerHandler()
{
LOGT("<testTimerHandler>");
Timer t1, t2;
TimerHandler handler;
handler.attach(t1, timeout1);
handler.attach(t2, timeout2);
t1.setInterval(1);
t2.setInterval(2);
sw1.start();
sw2.start();
t1.start();
t2.start();
Thread::sleep(15);
handler.detach(t2);
Thread::sleep(30);
t1.stop();
t2.stop();
Thread::sleep(105);
}
示例15: LOGT
void NetManager::event_onSessionDisconnect(TcpSessionPtr session)
{
LOGT("NetManager::event_onSessionDisconnect. SessionID=" << session->getSessionID() << ", remoteIP=" << session->getRemoteIP() << ", remotePort=" << session->getRemotePort());
if (isConnectID(session->getSessionID()))
{
}
else
{
if (session->getUserParam() == SS_LOGINED)
{
auto info = UserManager::getRef().getInnerUserInfoBySID(session->getSessionID());
if (info)
{
UserManager::getRef().userLogout(info);
info->sID = InvalidSeesionID;
}
}
}
if (UserManager::getRef().getAllOnlineUserCount() == 0 && _onSafeClosed)
{
SessionManager::getRef().post(_onSafeClosed);
_onSafeClosed = nullptr;
}
}