java.lang.Object
robaho.net.httpserver.http2.HTTP2Connection
-
Nested Class Summary
Nested Classes -
Constructor Summary
ConstructorsConstructorDescriptionHTTP2Connection(HttpConnection httpConnection, HTTP2Stats stats, InputStream input, OutputStream output, HTTP2Connection.StreamHandler handler) Constructor to instantiate HTTP2Connection object -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()voiddebug()voidhandle()booleanFunction to validate the PREFACE received on the input stream from the remote systembooleanisClosed()static voidreadFully(InputStream inputStream, byte[] buffer) voidsendGoAway(HTTP2ErrorCode errorCode) voidvoidsendPing()voidsendResetStream(HTTP2ErrorCode errorCode, int streamId) voidvoidtoString()voidupdateRemoteSettings(SettingsFrame remoteSettingFrame) voidwriteFrame(byte[] frame) voidwriteFrame(List<byte[]> partials) writes a frame that consists of multiple byte arrays.
-
Constructor Details
-
HTTP2Connection
public HTTP2Connection(HttpConnection httpConnection, HTTP2Stats stats, InputStream input, OutputStream output, HTTP2Connection.StreamHandler handler) Constructor to instantiate HTTP2Connection object- Parameters:
input- HTTP2Client passes the ExBufferedInputStreamoutput-
-
-
Method Details
-
debug
public void debug() -
toString
-
close
public void close() -
getRemoteSettings
-
getLocalSettings
-
writeFrame
- Throws:
IOException
-
writeFrame
writes a frame that consists of multiple byte arrays. the method is designed for low-volume frames where the overhead of creating a new byte array is minimal. Otherwise, the data/frame should be written directly to the output stream, e.g. see HTTP2Stream.Http2OutputStream- Throws:
IOException
-
hasProperPreface
Function to validate the PREFACE received on the input stream from the remote system- Returns:
- true if preface is valid
- Throws:
IOException
-
isClosed
public boolean isClosed() -
handle
- Throws:
Exception
-
updateRemoteSettings
- Throws:
HTTP2Exception
-
sendSettingsAck
- Throws:
IOException
-
sendMySettings
- Throws:
IOException
-
sendWindowUpdate
- Throws:
IOException
-
sendGoAway
- Throws:
IOException
-
sendResetStream
- Throws:
IOException
-
sendPing
- Throws:
IOException
-
readFully
- Throws:
IOException
-