public abstract class ConnectionBase extends Object
| Modifier and Type | Field and Description |
|---|---|
protected io.netty.channel.ChannelHandlerContext |
chctx |
static VertxException |
CLOSED_EXCEPTION
An exception used to signal a closed connection to an exception handler.
|
protected ContextInternal |
context |
static io.netty.util.AttributeKey<SocketAddress> |
LOCAL_ADDRESS_OVERRIDE |
static io.netty.util.AttributeKey<SocketAddress> |
REMOTE_ADDRESS_OVERRIDE |
protected VertxInternal |
vertx |
io.netty.channel.VoidChannelPromise |
voidPromise |
| Modifier | Constructor and Description |
|---|---|
protected |
ConnectionBase(ContextInternal context,
io.netty.channel.ChannelHandlerContext chctx) |
| Modifier and Type | Method and Description |
|---|---|
io.netty.channel.Channel |
channel() |
io.netty.channel.ChannelPromise |
channelFuture() |
io.netty.channel.ChannelHandlerContext |
channelHandlerContext() |
Future<Void> |
close()
Close the connection
|
void |
close(Handler<AsyncResult<Void>> handler)
Close the connection and notifies the
handler |
Future<Void> |
closeFuture() |
ConnectionBase |
closeHandler(Handler<Void> handler) |
void |
doPause() |
void |
doResume() |
void |
doSetWriteQueueMaxSize(int size) |
protected Handler<Throwable> |
exceptionHandler() |
ConnectionBase |
exceptionHandler(Handler<Throwable> handler) |
void |
fail(Throwable error)
Fail the connection, the
error will be sent to the pipeline and the connection will
stop processing any further message. |
void |
flush()
Asynchronous flush.
|
void |
flush(io.netty.channel.ChannelPromise promise)
Asynchronous flush.
|
void |
flushBytesRead() |
void |
flushBytesWritten() |
ContextInternal |
getContext() |
protected void |
handleClosed() |
protected void |
handleException(Throwable t) |
protected void |
handleIdle()
Called by the Netty handler when the connection becomes idle.
|
protected abstract void |
handleInterestedOpsChanged() |
protected void |
handleMessage(Object msg) |
String |
indicatedServerName() |
boolean |
isNotWritable() |
boolean |
isSsl() |
SocketAddress |
localAddress() |
Object |
metric() |
void |
metric(Object metric) |
abstract NetworkMetrics |
metrics() |
X509Certificate[] |
peerCertificateChain() |
SocketAddress |
remoteAddress() |
String |
remoteName() |
void |
reportBytesRead(long numberOfBytes) |
protected void |
reportBytesRead(Object msg) |
void |
reportBytesWritten(long numberOfBytes) |
protected void |
reportsBytesWritten(Object msg) |
io.netty.channel.ChannelFuture |
sendFile(RandomAccessFile raf,
long offset,
long length) |
SSLSession |
sslSession() |
protected boolean |
supportsFileRegion() |
void |
writeToChannel(Object obj) |
void |
writeToChannel(Object msg,
boolean forceFlush,
io.netty.channel.ChannelPromise promise) |
void |
writeToChannel(Object msg,
io.netty.channel.ChannelPromise promise) |
void |
writeToChannel(Object msg,
io.netty.util.concurrent.FutureListener<Void> listener) |
public static final VertxException CLOSED_EXCEPTION
public static final io.netty.util.AttributeKey<SocketAddress> REMOTE_ADDRESS_OVERRIDE
public static final io.netty.util.AttributeKey<SocketAddress> LOCAL_ADDRESS_OVERRIDE
public final io.netty.channel.VoidChannelPromise voidPromise
protected final VertxInternal vertx
protected final io.netty.channel.ChannelHandlerContext chctx
protected final ContextInternal context
protected ConnectionBase(ContextInternal context, io.netty.channel.ChannelHandlerContext chctx)
public Future<Void> closeFuture()
public void fail(Throwable error)
error will be sent to the pipeline and the connection will
stop processing any further message.error - the Throwable to propagatepublic final void writeToChannel(Object msg, io.netty.util.concurrent.FutureListener<Void> listener)
public final void writeToChannel(Object msg, io.netty.channel.ChannelPromise promise)
public final void writeToChannel(Object msg, boolean forceFlush, io.netty.channel.ChannelPromise promise)
public void writeToChannel(Object obj)
public final void flush()
public final void flush(io.netty.channel.ChannelPromise promise)
promise - the promise resolved when flush occurredpublic boolean isNotWritable()
public final void close(Handler<AsyncResult<Void>> handler)
handlerpublic ConnectionBase closeHandler(Handler<Void> handler)
public ConnectionBase exceptionHandler(Handler<Throwable> handler)
public void doPause()
public void doResume()
public void doSetWriteQueueMaxSize(int size)
public final io.netty.channel.Channel channel()
public final io.netty.channel.ChannelHandlerContext channelHandlerContext()
public final ContextInternal getContext()
public final void metric(Object metric)
public final Object metric()
public abstract NetworkMetrics metrics()
protected void handleException(Throwable t)
protected void handleClosed()
protected void handleIdle()
protected abstract void handleInterestedOpsChanged()
protected boolean supportsFileRegion()
protected void reportBytesRead(Object msg)
public void reportBytesRead(long numberOfBytes)
protected void reportsBytesWritten(Object msg)
public void reportBytesWritten(long numberOfBytes)
public void flushBytesRead()
public void flushBytesWritten()
public final io.netty.channel.ChannelFuture sendFile(RandomAccessFile raf, long offset, long length) throws IOException
IOExceptionpublic boolean isSsl()
public SSLSession sslSession()
public X509Certificate[] peerCertificateChain() throws SSLPeerUnverifiedException
SSLPeerUnverifiedExceptionpublic String indicatedServerName()
public io.netty.channel.ChannelPromise channelFuture()
public String remoteName()
public SocketAddress remoteAddress()
public SocketAddress localAddress()
protected void handleMessage(Object msg)
Copyright © 2021. All rights reserved.