@Override
            public void onTimeout(AsyncEvent asyncEvent) throws IOException {
                Log.trace("Session {} Request ID {}, event timeout: {}. Returning an empty response.", streamID, rid, asyncEvent);

                try {
                    // If onTimeout does not result in a complete(), the container falls back to default behavior.
                    // This is why this body is to be delivered in a non-async fashion.
                    synchronized (connectionQueue) {
                        // Consume the connection that is timing out, by removing it from the queue and sending data to it.
                        connectionQueue.remove(connection);
                        deliver(connection, Collections.singletonList(new Deliverable("")), false);
                        setLastResponseEmpty(true);
                    }
                } catch (HttpConnectionClosedException e) {
                    Log.warn("Unexpected exception while processing connection timeout.", e);
                }

                // Note that 'onComplete' will be invoked.
            }
Creates a new connection on this session.

@param body the body element that was sent containing the request for a new session.
@param context the context of the asynchronous servlet call leading up to this method call.
@return the created {@link HttpConnection} which represents the connection.
xmppserver/src/main/java/org/jivesoftware/openfire/http/HttpSession.java