Check session timeout or idle

@return
502687
private final long checkSessionTimeout() {
		long nextTimeout = 0;
		if (configuration.getCheckSessionTimeoutInterval() > 0) {
			gate.lock();
			try {
				if (selectTries * 1000 >= configuration
						.getCheckSessionTimeoutInterval()) {
					nextTimeout = configuration
							.getCheckSessionTimeoutInterval();
					for (SelectionKey key : selector.keys()) {

						if (key.attachment() != null) {
							long n = checkExpiredIdle(key,
									getSessionFromAttchment(key));
							nextTimeout = n < nextTimeout ? n : nextTimeout;
						}
					}
					selectTries = 0;
				}
			} finally {
				gate.unlock();
			}
		}
		return nextTimeout;
	}
857136
public synchronized static Session getSession() {
        if(session == null){
            Properties properties = IOUtil.loadProperties("jdbc.properties");
            session = getSession(properties);
        }

        return session;
    }
1003161
private static int initializeTimeout() {
//        Integer tmp = java.security.AccessController.doPrivileged(
//                new GetIntegerAction("com.sun.security.ocsp.timeout"));
        Integer tmp = Integer.getInteger("com.sun.security.ocsp.timeout");
        if (tmp == null || tmp < 0) {
            return DEFAULT_CONNECT_TIMEOUT;
        }
        // Convert to milliseconds, as the system property will be
        // specified in seconds
        return tmp * 1000;
    }
1141388
public void sessionIdle(IoSession session, IdleStatus status)
            throws Exception {
        SingleSessionIoHandler handler = (SingleSessionIoHandler) session
                .getAttribute(HANDLER);
        handler.sessionIdle(status);
    }
317732
public int getSessionTimeOut(DeployedModule webModuleConfig)
    {
        int timeout = 0;
        try
        {
            timeout = webModuleConfig.getWebAppConfig().getSessionTimeout();
        }
        catch (Exception e)
        {
            // do nothing
        }
        if (com.ibm.ejs.ras.TraceComponent.isAnyTracingEnabled() && LoggingUtil.SESSION_LOGGER_CORE.isLoggable(Level.FINE))
        {
            LoggingUtil.SESSION_LOGGER_CORE.logp(Level.FINE, methodClassName, "getSessionTimeOut", "" + timeout);
        }
        return timeout;
    }
1299929
def is_active(self, timeout=2):
        
        try:
            result = Result(*self.perform_request('HEAD', '/', params={'request_timeout': timeout}))
        except ConnectionError:
            return False
        except TransportError:
            return False

        if result.response.status_code == 200:
            return True

        return False
1331992
private boolean hasTimedOut(BackedSession d, long now) {
        boolean timedOut = false;
        int timeout = d.getMaxInactiveInterval();

        //Zero means we just read the session from database
        if (timeout > 0) {
            long lastTouch = d.getCurrentAccessTime();
            long invalidLastTouch = now - (1000 * (long) timeout);//PK90548

            if (lastTouch <= invalidLastTouch) {
                timedOut = true;
            }
        }

        return timedOut;
    }
638519
public Session getSysSession() {

        sysSession.currentSchema =
            sysSession.database.schemaManager.getDefaultSchemaHsqlName();
        sysSession.isProcessingScript = false;
        sysSession.isProcessingLog    = false;

        sysSession.setUser(sysSession.database.getUserManager().getSysUser());

        return sysSession;
    }
1264509
public ServerBuilder idleTimeout(Duration idleTimeout) {
        requireNonNull(idleTimeout, "idleTimeout");
        idleTimeoutMillis = ServerConfig.validateIdleTimeoutMillis(idleTimeout.toMillis());
        return this;
    }
48286
public synchronized int getSoTimeout() throws IOException {
        if (isClosed())
            throw new SocketException("Socket is closed");
        Object o = getImpl().getOption(SocketOptions.SO_TIMEOUT);
        /* extra type safety */
        if (o instanceof Integer) {
            return ((Integer) o).intValue();
        } else {
            return 0;
        }
    }
695015
private int initStepTransactionTimeout() {
        logger.entering(sourceClass, "initStepTransactionTimeout");
        Properties p = runtimeStepExecution.getProperties();
        int timeout = DEFAULT_TRAN_TIMEOUT_SECONDS; // default as per spec.
        if (p != null && !p.isEmpty()) {

            String propertyTimeOut = p.getProperty("javax.transaction.global.timeout");
            if (logger.isLoggable(Level.FINE)) {
                logger.log(Level.FINE, "javax.transaction.global.timeout = {0}", propertyTimeOut == null ? "<null>" : propertyTimeOut);
            }
            if (propertyTimeOut != null && !propertyTimeOut.isEmpty()) {
                timeout = Integer.parseInt(propertyTimeOut, 10);
            }
        }
        logger.exiting(sourceClass, "initStepTransactionTimeout", timeout);
        return timeout;
    }
608920
public String getAgeOfSession() {

        String[] ret = getHourMinuteSecondTimeString(System.currentTimeMillis() - m_timeCreated);
        return ret[0] + ":" + ret[1];

    }
1306425
def session_expired(self):
        
        if not self._login_time or (datetime.datetime.now()-self._login_time).total_seconds() > 12000:
            return True
125642
public long timeout()
    {
        if (tickets.isEmpty()) {
            return -1;
        }
        sortIfNeeded();
        //  Tickets are sorted, so check first ticket
        Ticket first = tickets.get(0);
        return first.start - now() + first.delay;
    }
480160
def _check_timeouts(self):
        

        for conn_id, data in self._connections.items():
            if 'timeout' in data and data['timeout'].expired:
                if data['state'] == self.Connecting:
                    self.finish_connection(conn_id, False, 'Connection attempt timed out')
                elif data['state'] == self.Disconnecting:
                    self.finish_disconnection(conn_id, False, 'Disconnection attempt timed out')
                elif data['state'] == self.InProgress:
                    if data['microstate'] == 'rpc':
                        self.finish_operation(conn_id, False, 'RPC timed out without response', None, None)
                    elif data['microstate'] == 'open_interface':
                        self.finish_operation(conn_id, False, 'Open interface request timed out')
1228938
public long getTimeout()
  {
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) 
      SibTr.entry(tc, "getTimeout");
      
    long timeout = aiRequestedTick.getTimeout();
    
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) 
      SibTr.exit(tc, "getTimeout", new Long(timeout));
    return timeout;
  }
1114291
public List<Long> getTimedOutSessions() {
    List<Long> ret = new ArrayList<>();
    synchronized (mSessions) {
      for (Entry<Long, SessionInfo> entry : mSessions.entrySet()) {
        if (entry.getValue().timeout()) {
          ret.add(entry.getKey());
        }
      }
    }
    return ret;
  }