Class Http2ConnectionWriter

java.lang.Object
io.helidon.http.http2.Http2ConnectionWriter
All Implemented Interfaces:
Http2StreamWriter

public class Http2ConnectionWriter extends Object implements Http2StreamWriter
HTTP/2 connection writer.
  • Constructor Details

    • Http2ConnectionWriter

      public Http2ConnectionWriter(SocketContext ctx, DataWriter writer, List<Http2FrameListener> sendFrameListeners)
      A new writer.
      Parameters:
      ctx - connection context
      writer - data writer
      sendFrameListeners - send frame listeners
  • Method Details

    • write

      public void write(Http2FrameData frame)
      Description copied from interface: Http2StreamWriter
      Write a frame.
      Specified by:
      write in interface Http2StreamWriter
      Parameters:
      frame - frame to write
    • tryWrite

      public boolean tryWrite(Http2FrameData frame, Runnable beforeWrite)
      Attempts to write a frame without waiting for another frame write to finish.
      Parameters:
      frame - frame to write
      beforeWrite - action to invoke after acquiring the frame serialization lock and before writing
      Returns:
      true if the frame was written, false if another frame write is in progress
    • writeData

      public void writeData(Http2FrameData frame, FlowControl.Outbound flowControl)
      Description copied from interface: Http2StreamWriter
      Write a frame with flow control.
      Specified by:
      writeData in interface Http2StreamWriter
      Parameters:
      frame - data frame
      flowControl - outbound flow control
    • writeHeaders

      public int writeHeaders(Http2Headers headers, int streamId, Http2Flag.HeaderFlags flags, FlowControl.Outbound flowControl)
      Description copied from interface: Http2StreamWriter
      Write headers with no (or streaming) entity.
      Specified by:
      writeHeaders in interface Http2StreamWriter
      Parameters:
      headers - headers
      streamId - stream ID
      flags - flags to use
      flowControl - flow control
      Returns:
      number of bytes written
    • writeHeaders

      public int writeHeaders(Http2Headers headers, int streamId, Http2Flag.HeaderFlags flags, Http2FrameData dataFrame, FlowControl.Outbound flowControl)
      Description copied from interface: Http2StreamWriter
      Write headers and entity.
      Specified by:
      writeHeaders in interface Http2StreamWriter
      Parameters:
      headers - headers
      streamId - stream ID
      flags - header flags
      dataFrame - data frame
      flowControl - flow control
      Returns:
      number of bytes written
    • updateHeaderTableSize

      public void updateHeaderTableSize(long newSize) throws InterruptedException
      Record an outbound header table size allowed by the peer. The change takes effect after the corresponding SETTINGS acknowledgment is written. The encoder keeps its local default as an upper bound and writes any required HPACK dynamic table size update at the beginning of the next header block.
      Parameters:
      newSize - maximum size accepted by the peer, in bytes
      Throws:
      InterruptedException - in case we fail to lock on the stream