public class ConnectHandler.DownstreamConnection extends ProxyConnection implements Connection.UpgradeTo
Connection.Listener, Connection.UpgradeFrom, Connection.UpgradeTo
LOG
Constructor and Description |
---|
DownstreamConnection(EndPoint endPoint,
Executor executor,
ByteBufferPool bufferPool,
ConcurrentMap<String,Object> context) |
Modifier and Type | Method and Description |
---|---|
void |
onOpen()
Callback method invoked when this connection is opened.
|
void |
onUpgradeTo(ByteBuffer buffer)
Callback method invoked when this connection is upgraded.
|
protected int |
read(EndPoint endPoint,
ByteBuffer buffer) |
protected void |
write(EndPoint endPoint,
ByteBuffer buffer,
Callback callback) |
getByteBufferPool, getConnection, getContext, onFillable, setConnection, toConnectionString
addListener, close, failedCallback, fillInterested, getBytesIn, getBytesOut, getCreatedTimeStamp, getEndPoint, getExecutor, getInputBufferSize, getMessagesIn, getMessagesOut, isFillInterested, onClose, onFillInterestedFailed, onIdleExpired, onReadTimeout, removeListener, setInputBufferSize, toString, tryFillInterested, tryFillInterested
public DownstreamConnection(EndPoint endPoint, Executor executor, ByteBufferPool bufferPool, ConcurrentMap<String,Object> context)
public void onUpgradeTo(ByteBuffer buffer)
Connection.UpgradeTo
Callback method invoked when this connection is upgraded.
This must be called before Connection.onOpen()
.
onUpgradeTo
in interface Connection.UpgradeTo
buffer
- An optional buffer that can contain prefilled data. Typically this
results from an upgrade of one protocol to the other where the old connection has buffered
data destined for the new connection. The new connection must take ownership of the buffer
and is responsible for returning it to the buffer poolpublic void onOpen()
Connection
Callback method invoked when this connection is opened.
Creators of the connection implementation are responsible for calling this method.
onOpen
in interface Connection
onOpen
in class AbstractConnection
protected int read(EndPoint endPoint, ByteBuffer buffer) throws IOException
read
in class ProxyConnection
IOException
protected void write(EndPoint endPoint, ByteBuffer buffer, Callback callback)
write
in class ProxyConnection
Copyright © 1995–2017 Webtide. All rights reserved.