public class HTTP2Connection extends AbstractConnection implements WriteFlusher.Listener
| Modifier and Type | Class and Description |
|---|---|
protected class |
HTTP2Connection.HTTP2Producer |
Connection.Listener, Connection.UpgradeFrom, Connection.UpgradeTo| Constructor and Description |
|---|
HTTP2Connection(ByteBufferPool byteBufferPool,
java.util.concurrent.Executor executor,
EndPoint endPoint,
Parser parser,
ISession session,
int bufferSize) |
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Performs a logical close of this connection.
|
protected void |
dispatch() |
long |
getBytesIn() |
long |
getBytesOut() |
protected Parser |
getParser() |
ISession |
getSession() |
protected void |
offerTask(java.lang.Runnable task,
boolean dispatch) |
void |
onClose()
Callback method invoked when this connection is closed.
|
void |
onFillable()
Callback method invoked when the endpoint is ready to be read.
|
void |
onFlushed(long bytes)
Invoked when a
WriteFlusher flushed bytes in a non-blocking way,
as part of a - possibly larger - write. |
boolean |
onIdleExpired()
Callback method invoked upon an idle timeout event.
|
void |
onOpen()
Callback method invoked when this connection is opened.
|
protected void |
produce() |
protected void |
setInputBuffer(java.nio.ByteBuffer buffer) |
addListener, failedCallback, fillInterested, getCreatedTimeStamp, getEndPoint, getExecutor, getInputBufferSize, getMessagesIn, getMessagesOut, isFillInterested, onFillInterestedFailed, onReadTimeout, removeListener, setInputBufferSize, toConnectionString, toString, tryFillInterested, tryFillInterestedprotected static final Logger LOG
public HTTP2Connection(ByteBufferPool byteBufferPool, java.util.concurrent.Executor executor, EndPoint endPoint, Parser parser, ISession session, int bufferSize)
public long getBytesIn()
getBytesIn in interface ConnectiongetBytesIn in class AbstractConnectionpublic long getBytesOut()
getBytesOut in interface ConnectiongetBytesOut in class AbstractConnectionpublic ISession getSession()
protected Parser getParser()
protected void setInputBuffer(java.nio.ByteBuffer buffer)
public void onOpen()
ConnectionCallback method invoked when this connection is opened.
Creators of the connection implementation are responsible for calling this method.
onOpen in interface ConnectiononOpen in class AbstractConnectionpublic void onClose()
ConnectionCallback method invoked when this connection is closed.
Creators of the connection implementation are responsible for calling this method.
onClose in interface ConnectiononClose in class AbstractConnectionpublic void onFillable()
AbstractConnectionCallback method invoked when the endpoint is ready to be read.
onFillable in class AbstractConnectionAbstractConnection.fillInterested()public boolean onIdleExpired()
ConnectionCallback method invoked upon an idle timeout event.
Implementations of this method may return true to indicate that the idle timeout handling should proceed normally, typically failing the EndPoint and causing it to be closed.
When false is returned, the handling of the idle timeout event is halted immediately and the EndPoint left in the state it was before the idle timeout event.
onIdleExpired in interface ConnectiononIdleExpired in class AbstractConnectionprotected void offerTask(java.lang.Runnable task,
boolean dispatch)
protected void produce()
protected void dispatch()
public void close()
ConnectionPerforms a logical close of this connection.
For simple connections, this may just mean to delegate the close to the associated
EndPoint but, for example, SSL connections should write the SSL close message
before closing the associated EndPoint.
close in interface java.io.Closeableclose in interface java.lang.AutoCloseableclose in interface Connectionclose in class AbstractConnectionpublic void onFlushed(long bytes)
throws java.io.IOException
WriteFlusher.ListenerInvoked when a WriteFlusher flushed bytes in a non-blocking way,
as part of a - possibly larger - write.
This method may be invoked multiple times, for example when writing a large buffer: a first flush of bytes, then the connection became TCP congested, and a subsequent flush of bytes when the connection became writable again.
This method is never invoked concurrently, but may be invoked by different threads, so implementations may not rely on thread-local variables.
Implementations may throw an IOException to signal that the write
should fail, for example if the implementation enforces a minimum data rate.
onFlushed in interface WriteFlusher.Listenerbytes - the number of bytes flushedjava.io.IOException - if the write should failCopyright © 1995–2023 Webtide. All rights reserved.