public class NioSocketChannel
extends io.netty.channel.nio.AbstractNioByteChannel
implements io.netty.channel.socket.SocketChannel
SocketChannel
which uses NIO selector based implementation.io.netty.channel.nio.AbstractNioByteChannel.NioByteUnsafe
io.netty.channel.nio.AbstractNioChannel.AbstractNioUnsafe, io.netty.channel.nio.AbstractNioChannel.NioUnsafe
Modifier and Type | Field and Description |
---|---|
static io.prometheus.client.Histogram |
socketReadBytes |
static io.prometheus.client.Histogram |
socketReadDuration |
static io.prometheus.client.Histogram |
socketReadLeftBytes |
static io.prometheus.client.Histogram |
socketWriteBytes |
static io.prometheus.client.Histogram |
socketWriteDuration |
static io.prometheus.client.Histogram |
socketWriteLeftBytes |
static io.prometheus.client.Histogram |
socketWrittenBytes |
Constructor and Description |
---|
NioSocketChannel()
Create a new instance
|
NioSocketChannel(io.netty.channel.Channel parent,
SocketChannel socket)
Create a new instance
|
NioSocketChannel(SelectorProvider provider)
Create a new instance using the given
SelectorProvider . |
NioSocketChannel(SocketChannel socket)
Create a new instance using the given
SocketChannel . |
Modifier and Type | Method and Description |
---|---|
io.netty.channel.socket.SocketChannelConfig |
config() |
protected void |
doBind(SocketAddress localAddress) |
protected void |
doClose() |
protected boolean |
doConnect(SocketAddress remoteAddress,
SocketAddress localAddress) |
protected void |
doDisconnect() |
protected void |
doFinishConnect() |
protected int |
doReadBytes(io.netty.buffer.ByteBuf byteBuf) |
protected void |
doShutdownOutput() |
protected void |
doWrite(io.netty.channel.ChannelOutboundBuffer in) |
protected int |
doWriteBytes(io.netty.buffer.ByteBuf buf) |
protected long |
doWriteFileRegion(io.netty.channel.FileRegion region) |
boolean |
isActive() |
boolean |
isInputShutdown() |
protected boolean |
isInputShutdown0() |
boolean |
isOutputShutdown() |
boolean |
isShutdown() |
protected SocketChannel |
javaChannel() |
InetSocketAddress |
localAddress() |
protected SocketAddress |
localAddress0() |
protected io.netty.channel.nio.AbstractNioChannel.AbstractNioUnsafe |
newUnsafe() |
io.netty.channel.socket.ServerSocketChannel |
parent() |
InetSocketAddress |
remoteAddress() |
protected SocketAddress |
remoteAddress0() |
io.netty.channel.ChannelFuture |
shutdown() |
io.netty.channel.ChannelFuture |
shutdown(io.netty.channel.ChannelPromise promise) |
io.netty.channel.ChannelFuture |
shutdownInput() |
io.netty.channel.ChannelFuture |
shutdownInput(io.netty.channel.ChannelPromise promise) |
io.netty.channel.ChannelFuture |
shutdownOutput() |
io.netty.channel.ChannelFuture |
shutdownOutput(io.netty.channel.ChannelPromise promise) |
clearOpWrite, doWrite0, filterOutboundMessage, incompleteWrite, metadata, setOpWrite
clearReadPending, doBeginRead, doDeregister, doRegister, eventLoop, isCompatible, isOpen, isReadPending, newDirectBuffer, newDirectBuffer, selectionKey, setReadPending, unsafe
alloc, bind, bind, bytesBeforeUnwritable, bytesBeforeWritable, close, close, closeFuture, compareTo, connect, connect, connect, connect, deregister, deregister, disconnect, disconnect, equals, flush, hashCode, id, invalidateLocalAddress, invalidateRemoteAddress, isRegistered, isWritable, maxMessagesPerWrite, newChannelPipeline, newFailedFuture, newId, newProgressivePromise, newPromise, newSucceededFuture, pipeline, read, toString, validateFileRegion, voidPromise, write, write, writeAndFlush, writeAndFlush
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
alloc, bytesBeforeUnwritable, bytesBeforeWritable, closeFuture, eventLoop, flush, id, isOpen, isRegistered, isWritable, metadata, pipeline, read, unsafe
bind, bind, close, close, connect, connect, connect, connect, deregister, deregister, disconnect, disconnect, newFailedFuture, newProgressivePromise, newPromise, newSucceededFuture, voidPromise, write, write, writeAndFlush, writeAndFlush
compareTo
public static final io.prometheus.client.Histogram socketWriteDuration
public static final io.prometheus.client.Histogram socketWriteBytes
public static final io.prometheus.client.Histogram socketWrittenBytes
public static final io.prometheus.client.Histogram socketWriteLeftBytes
public static final io.prometheus.client.Histogram socketReadDuration
public static final io.prometheus.client.Histogram socketReadBytes
public static final io.prometheus.client.Histogram socketReadLeftBytes
public NioSocketChannel()
public NioSocketChannel(SelectorProvider provider)
SelectorProvider
.public NioSocketChannel(SocketChannel socket)
SocketChannel
.public NioSocketChannel(io.netty.channel.Channel parent, SocketChannel socket)
parent
- the Channel
which created this instance or null
if it was created
by the usersocket
- the SocketChannel
which will be usedpublic io.netty.channel.socket.ServerSocketChannel parent()
parent
in interface io.netty.channel.Channel
parent
in interface io.netty.channel.socket.SocketChannel
parent
in class io.netty.channel.AbstractChannel
public io.netty.channel.socket.SocketChannelConfig config()
config
in interface io.netty.channel.Channel
config
in interface io.netty.channel.socket.SocketChannel
protected SocketChannel javaChannel()
javaChannel
in class io.netty.channel.nio.AbstractNioChannel
public boolean isActive()
isActive
in interface io.netty.channel.Channel
public boolean isOutputShutdown()
isOutputShutdown
in interface io.netty.channel.socket.DuplexChannel
public boolean isInputShutdown()
isInputShutdown
in interface io.netty.channel.socket.DuplexChannel
public boolean isShutdown()
isShutdown
in interface io.netty.channel.socket.DuplexChannel
public InetSocketAddress localAddress()
localAddress
in interface io.netty.channel.Channel
localAddress
in interface io.netty.channel.socket.SocketChannel
localAddress
in class io.netty.channel.AbstractChannel
public InetSocketAddress remoteAddress()
remoteAddress
in interface io.netty.channel.Channel
remoteAddress
in interface io.netty.channel.socket.SocketChannel
remoteAddress
in class io.netty.channel.AbstractChannel
@UnstableApi protected final void doShutdownOutput() throws Exception
doShutdownOutput
in class io.netty.channel.AbstractChannel
Exception
public io.netty.channel.ChannelFuture shutdownOutput()
shutdownOutput
in interface io.netty.channel.socket.DuplexChannel
public io.netty.channel.ChannelFuture shutdownOutput(io.netty.channel.ChannelPromise promise)
shutdownOutput
in interface io.netty.channel.socket.DuplexChannel
public io.netty.channel.ChannelFuture shutdownInput()
shutdownInput
in interface io.netty.channel.socket.DuplexChannel
shutdownInput
in class io.netty.channel.nio.AbstractNioByteChannel
protected boolean isInputShutdown0()
isInputShutdown0
in class io.netty.channel.nio.AbstractNioByteChannel
public io.netty.channel.ChannelFuture shutdownInput(io.netty.channel.ChannelPromise promise)
shutdownInput
in interface io.netty.channel.socket.DuplexChannel
public io.netty.channel.ChannelFuture shutdown()
shutdown
in interface io.netty.channel.socket.DuplexChannel
public io.netty.channel.ChannelFuture shutdown(io.netty.channel.ChannelPromise promise)
shutdown
in interface io.netty.channel.socket.DuplexChannel
protected SocketAddress localAddress0()
localAddress0
in class io.netty.channel.AbstractChannel
protected SocketAddress remoteAddress0()
remoteAddress0
in class io.netty.channel.AbstractChannel
protected void doBind(SocketAddress localAddress) throws Exception
doBind
in class io.netty.channel.AbstractChannel
Exception
protected boolean doConnect(SocketAddress remoteAddress, SocketAddress localAddress) throws Exception
doConnect
in class io.netty.channel.nio.AbstractNioChannel
Exception
protected void doFinishConnect() throws Exception
doFinishConnect
in class io.netty.channel.nio.AbstractNioChannel
Exception
protected void doDisconnect() throws Exception
doDisconnect
in class io.netty.channel.AbstractChannel
Exception
protected void doClose() throws Exception
doClose
in class io.netty.channel.nio.AbstractNioChannel
Exception
protected int doReadBytes(io.netty.buffer.ByteBuf byteBuf) throws Exception
doReadBytes
in class io.netty.channel.nio.AbstractNioByteChannel
Exception
protected int doWriteBytes(io.netty.buffer.ByteBuf buf) throws Exception
doWriteBytes
in class io.netty.channel.nio.AbstractNioByteChannel
Exception
protected long doWriteFileRegion(io.netty.channel.FileRegion region) throws Exception
doWriteFileRegion
in class io.netty.channel.nio.AbstractNioByteChannel
Exception
protected void doWrite(io.netty.channel.ChannelOutboundBuffer in) throws Exception
doWrite
in class io.netty.channel.nio.AbstractNioByteChannel
Exception
protected io.netty.channel.nio.AbstractNioChannel.AbstractNioUnsafe newUnsafe()
newUnsafe
in class io.netty.channel.nio.AbstractNioByteChannel
Copyright © 2023 PingCAP. All rights reserved.