private HttpSession createSession(HttpConnection connection, Locale language, Duration wait,
                                      int hold, boolean isEncrypted, Duration maxPollingInterval,
                                      int maxRequests, Duration maxPause, Duration defaultInactivityTimeout,
                                      int majorVersion, int minorVersion) throws UnauthorizedException, UnknownHostException
    {
        // Create a ClientSession for this user.
        StreamID streamID = SessionManager.getInstance().nextStreamID();
        // Send to the server that a new client session has been created
        HttpSession session = sessionManager.createClientHttpSession(streamID, connection, language, wait, hold, isEncrypted,
                                                                     maxPollingInterval, maxRequests, maxPause,
                                                                     defaultInactivityTimeout, majorVersion, minorVersion);
        // Register that the new session is associated with the specified stream ID
        sessionMap.put(streamID.getID(), session);
        SessionEventDispatcher.addListener( sessionListener );
        return session;
    }
Period of time a polling session has to be idle to be closed. Default is 60 seconds. Sending stanzas to the
client is not considered as activity. We are only considering the connection active when the
client sends some data or heartbeats (i.e. whitespaces) to the server. The reason for this is
that sending data will fail if the connection is closed. And if the thread is blocked while
sending data (because the socket is closed) then the clean up thread will close the socket
anyway.
xmppserver/src/main/java/org/jivesoftware/openfire/http/HttpSessionManager.java