bool SocketSession::check(){ time_t now = time(NULL); //检查不活跃期超时(activity) if(now - getLastActivity() > getWait()){ LOG_DEBUG("SocketSession::check => del a session : sid = " << getSessionId() << " userId = " << getUserId()); LOG_TRACE_ACTION(" sockSessionTimeOut"<<" | "<<getUserId()<<" | "<<getSessionId()<<" | "<<getCAppId()<<" | "<<"000000"); internalClose(); return 1; } return 0; }
void Client::on(Second, uint64_t aTick) noexcept{ if (state == STATE_DISCONNECTED && getAutoReconnect() && (aTick > (getLastActivity() + getReconnDelay() * 1000))) { // Try to reconnect... connect(); } if (searchQueue.hasWaitingTime(aTick)) return; if (isConnected()){ auto s = move(searchQueue.pop()); if (s){ search(move(s)); } } }
void Client::on(Second, uint64_t aTick) noexcept { if (state == STATE_DISCONNECTED && getAutoReconnect() && (aTick > (getLastActivity() + getReconnDelay() * 1000))) { // Try to reconnect... connect(); } if (!searchQueue.interval) return; if (isConnected()) { Search s; if (searchQueue.pop(s, aTick)) // [!] IRainman opt { // TODO - пробежатьс¤ по битовой маске? // ≈сли она там есть search(s.m_sizeMode, s.m_size, Search::TypeModes(s.m_fileTypes_bitmap), s.m_query, s.m_token, s.m_exts, s.m_is_force_passive); } } }
void Client::on(Second, uint32_t aTick) throw() { if(state == STATE_DISCONNECTED && getAutoReconnect() && (aTick > (getLastActivity() + getReconnDelay() * 1000)) ) { // Try to reconnect... connect(); } }