java.lang.Object
io.helidon.http.http2.Http2ConnectionWriter
- All Implemented Interfaces:
Http2StreamWriter
HTTP/2 connection writer.
-
Constructor Summary
ConstructorsConstructorDescriptionHttp2ConnectionWriter(SocketContext ctx, DataWriter writer, List<Http2FrameListener> sendFrameListeners) A new writer. -
Method Summary
Modifier and TypeMethodDescriptionbooleantryWrite(Http2FrameData frame, Runnable beforeWrite) Attempts to write a frame without waiting for another frame write to finish.voidupdateHeaderTableSize(long newSize) Record an outbound header table size allowed by the peer.voidwrite(Http2FrameData frame) Write a frame.voidwriteData(Http2FrameData frame, FlowControl.Outbound flowControl) Write a frame with flow control.intwriteHeaders(Http2Headers headers, int streamId, Http2Flag.HeaderFlags flags, FlowControl.Outbound flowControl) Write headers with no (or streaming) entity.intwriteHeaders(Http2Headers headers, int streamId, Http2Flag.HeaderFlags flags, Http2FrameData dataFrame, FlowControl.Outbound flowControl) Write headers and entity.
-
Constructor Details
-
Http2ConnectionWriter
public Http2ConnectionWriter(SocketContext ctx, DataWriter writer, List<Http2FrameListener> sendFrameListeners) A new writer.- Parameters:
ctx- connection contextwriter- data writersendFrameListeners- send frame listeners
-
-
Method Details
-
write
Description copied from interface:Http2StreamWriterWrite a frame.- Specified by:
writein interfaceHttp2StreamWriter- Parameters:
frame- frame to write
-
tryWrite
Attempts to write a frame without waiting for another frame write to finish.- Parameters:
frame- frame to writebeforeWrite- action to invoke after acquiring the frame serialization lock and before writing- Returns:
trueif the frame was written,falseif another frame write is in progress
-
writeData
Description copied from interface:Http2StreamWriterWrite a frame with flow control.- Specified by:
writeDatain interfaceHttp2StreamWriter- Parameters:
frame- data frameflowControl- outbound flow control
-
writeHeaders
public int writeHeaders(Http2Headers headers, int streamId, Http2Flag.HeaderFlags flags, FlowControl.Outbound flowControl) Description copied from interface:Http2StreamWriterWrite headers with no (or streaming) entity.- Specified by:
writeHeadersin interfaceHttp2StreamWriter- Parameters:
headers- headersstreamId- stream IDflags- flags to useflowControl- 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:Http2StreamWriterWrite headers and entity.- Specified by:
writeHeadersin interfaceHttp2StreamWriter- Parameters:
headers- headersstreamId- stream IDflags- header flagsdataFrame- data frameflowControl- flow control- Returns:
- number of bytes written
-
updateHeaderTableSize
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
-