SessionSPI

<p>The SPI interface for implementing a HTTP/2 session.</p> <p>This class :{@link Session} by adding the methods required to implement the HTTP/2 session functionalities.</p>

Members

Functions

data
void data(StreamSPI stream, Callback callback, DataFrame frame)

<p>Enqueues the given DATA frame to be written to the connection.</p>

frames
void frames(StreamSPI stream, Callback callback, Frame frame, Frame[] frames)

<p>Enqueues the given frames to be written to the connection.</p>

getBytesWritten
long getBytesWritten()

@return the number of bytes written by this session

getStream
StreamSPI getStream(int streamId)
Undocumented in source.
isPushEnabled
bool isPushEnabled()

@return whether the push functionality is enabled

onFrame
void onFrame(Frame frame)

<p>Callback method invoked during an HTTP/1.1 to HTTP/2 upgrade requests to process the given synthetic frame.</p>

onIdleTimeout
bool onIdleTimeout()

<p>Callback invoked when the idle timeout expires.</p>

onShutdown
void onShutdown()

<p>Callback invoked when the connection reads -1.</p>

onWindowUpdate
void onWindowUpdate(StreamSPI stream, WindowUpdateFrame frame)

<p>Callback method invoked when a WINDOW_UPDATE frame has been received.</p>

push
void push(StreamSPI stream, Promise!Stream promise, PushPromiseFrame frame, Stream.Listener listener)

<p>Enqueues the given PUSH_PROMISE frame to be written to the connection.</p> <p>Differently from {@link #frames(StreamSPI, Callback, Frame, Frame...)}, this method generates atomically the stream id for the pushed stream.</p>

removeStream
void removeStream(StreamSPI stream)

<p>Removes the given {@code stream}.</p>

updateRecvWindow
int updateRecvWindow(int delta)

<p>Updates the session receive window by the given {@code delta}.</p>

updateSendWindow
int updateSendWindow(int delta)

<p>Updates the session send window by the given {@code delta}.</p>

Inherited Members

From Session

newStream
void newStream(HeadersFrame frame, Promise!Stream promise, Stream.Listener listener)

<p>Sends the given HEADERS {@code frame} to create a new {@link Stream}.</p>

priority
int priority(PriorityFrame frame, Callback callback)

<p>Sends the given PRIORITY {@code frame}.</p> <p>If the {@code frame} references a {@code streamId} that does not exist (for example {@code 0}), then a new {@code streamId} will be allocated, to support <em>unused anchor streams</em> that act as parent for other streams.</p>

settings
void settings(SettingsFrame frame, Callback callback)

<p>Sends the given SETTINGS {@code frame} to configure the session.</p>

ping
void ping(PingFrame frame, Callback callback)

<p>Sends the given PING {@code frame}.</p> <p>PING frames may be used to test the connection integrity and to measure round-trip time.</p>

close
bool close(int error, string payload, Callback callback)

<p>Closes the session by sending a GOAWAY frame with the given error code and payload.</p> <p>The GOAWAY frame is sent only once; subsequent or concurrent attempts to close the session will have no effect.</p>

isClosed
bool isClosed()

@return whether the session is not open

getStreams
Stream[] getStreams()

@return a snapshot of all the streams currently belonging to this session

getStream
Stream getStream(int streamId)

<p>Retrieves the stream with the given {@code streamId}.</p>

toString
string toString()
Undocumented in source.
Listener
interface Listener

<p>A {@link Listener} is the passive counterpart of a {@link Session} and receives events happening on a HTTP/2 connection.</p>

Meta