Class HttpConnectionOverHTTP

    • Constructor Detail

      • HttpConnectionOverHTTP

        public HttpConnectionOverHTTP​(EndPoint endPoint,
                                      java.util.Map<java.lang.String,​java.lang.Object> context)
    • Method Detail

      • addBytesIn

        protected void addBytesIn​(long bytesIn)
      • addBytesOut

        protected void addBytesOut​(long bytesOut)
      • send

        public void send​(Request request,
                         Response.CompleteListener listener)
        Description copied from interface: Connection
        Sends a request with an associated response listener.

        Request.send(Response.CompleteListener) will eventually call this method to send the request. It is exposed to allow applications to send requests via unpooled connections.

        Specified by:
        send in interface Connection
        Parameters:
        request - the request to send
        listener - the response listener
      • onOpen

        public void onOpen()
        Description copied from interface: Connection

        Callback method invoked when this connection is opened.

        Creators of the connection implementation are responsible for calling this method.

        Specified by:
        onOpen in interface Connection
        Overrides:
        onOpen in class AbstractConnection
      • setAttachment

        public void setAttachment​(java.lang.Object obj)
        Description copied from interface: Attachable
        Attaches the given object to this stream for later retrieval.
        Specified by:
        setAttachment in interface Attachable
        Parameters:
        obj - the object to attach to this instance
      • onIdleExpired

        public boolean onIdleExpired()
        Description copied from interface: Connection

        Callback method invoked upon an idle timeout event.

        Implementations of this method may return true to indicate that the idle timeout handling should proceed normally, typically failing the EndPoint and causing it to be closed.

        When false is returned, the handling of the idle timeout event is halted immediately and the EndPoint left in the state it was before the idle timeout event.

        Specified by:
        onIdleExpired in interface Connection
        Overrides:
        onIdleExpired in class AbstractConnection
        Returns:
        true to let the EndPoint handle the idle timeout, false to tell the EndPoint to halt the handling of the idle timeout.
      • onIdleTimeout

        protected boolean onIdleTimeout​(long idleTimeout)
      • onUpgradeFrom

        public java.nio.ByteBuffer onUpgradeFrom()
        Description copied from interface: Connection.UpgradeFrom

        Invoked during an upgrade to produce a buffer containing bytes that have not been consumed by this connection, and that must be consumed by the upgrade-to connection.

        Specified by:
        onUpgradeFrom in interface Connection.UpgradeFrom
        Returns:
        a buffer of unconsumed bytes to pass to the upgrade-to connection. The buffer does not belong to any pool and should be discarded after having consumed its bytes. The returned buffer may be null if there are no unconsumed bytes.
      • release

        public void release()
      • close

        public void close()
        Description copied from interface: Connection

        Performs a logical close of this connection.

        For simple connections, this may just mean to delegate the close to the associated EndPoint but, for example, SSL connections should write the SSL close message before closing the associated EndPoint.

        Specified by:
        close in interface java.lang.AutoCloseable
        Specified by:
        close in interface java.io.Closeable
        Specified by:
        close in interface Connection
        Specified by:
        close in interface Connection
        Overrides:
        close in class AbstractConnection
      • close

        protected void close​(java.lang.Throwable failure)
      • abort

        protected boolean abort​(java.lang.Throwable failure)
      • sweep

        public boolean sweep()
        Specified by:
        sweep in interface Sweeper.Sweepable
        Returns:
        whether this resource should be swept
      • remove

        public void remove()