Package 

Class Http2Stream


  • 
    public final class Http2Stream
    
                        

    A logical bidirectional stream.

    • Method Detail

      • getErrorCode

         synchronized ErrorCode getErrorCode()

        Returns the reason why this stream was closed, or null if it closed normally or has not yetbeen closed.

      • isOpen

         synchronized boolean isOpen()

        Returns true if this stream is open. A stream is open until either:

        • A {@code SYN_RESET} frame abnormally terminates the stream.
        • Both input and output streams have transmitted all data and headers.

        Note that the input stream may continue to yield data even after a stream reports itself asnot open. This is because input data is buffered.

      • isLocallyInitiated

         boolean isLocallyInitiated()

        Returns true if this stream was created by this peer.

      • takeResponseHeaders

         synchronized List<Header> takeResponseHeaders()

        Removes and returns the stream's received response headers, blocking if necessary until headershave been received. If the returned list contains multiple blocks of headers the blocks will bedelimited by 'null'.

      • sendResponseHeaders

         void sendResponseHeaders(List<Header> responseHeaders, boolean out)

        Sends a reply to an incoming stream.

        Parameters:
        out - true to create an output stream that we can use to send data to the remote peer.
      • close

         void close(ErrorCode rstStatusCode)

        Abnormally terminate this stream. This blocks until the {@code RST_STREAM} frame has beentransmitted.

      • closeLater

         void closeLater(ErrorCode errorCode)

        Abnormally terminate this stream. This enqueues a {@code RST_STREAM} frame and returnsimmediately.