public final class EpollSocketChannel extends AbstractEpollStreamChannel implements io.netty.channel.socket.SocketChannel
SocketChannel
implementation that uses linux EPOLL Edge-Triggered Mode for
maximal performance.AbstractEpollStreamChannel.SpliceInTask
Modifier and Type | Field and Description |
---|---|
protected boolean |
active |
protected int |
flags |
Constructor and Description |
---|
EpollSocketChannel() |
EpollSocketChannel(FileDescriptor fd)
Deprecated.
|
EpollSocketChannel(Socket fd,
boolean active)
Creates a new
EpollSocketChannel from an existing FileDescriptor . |
Modifier and Type | Method and Description |
---|---|
protected static void |
checkResolvable(InetSocketAddress addr) |
EpollSocketChannelConfig |
config() |
protected void |
doBeginRead() |
protected void |
doBind(SocketAddress local) |
protected boolean |
doConnect(SocketAddress remoteAddress,
SocketAddress localAddress)
Connect to the remote peer
|
protected void |
doDeregister() |
protected void |
doDisconnect() |
protected int |
doReadBytes(io.netty.buffer.ByteBuf byteBuf)
Read bytes into the given
ByteBuf and return the amount. |
protected void |
doRegister() |
protected int |
doWriteBytes(io.netty.buffer.ByteBuf buf,
int writeSpinCount) |
Socket |
fd()
Returns the
FileDescriptor that is used by this Channel . |
boolean |
isActive() |
protected boolean |
isCompatible(io.netty.channel.EventLoop loop) |
boolean |
isInputShutdown() |
boolean |
isOpen() |
boolean |
isOutputShutdown() |
InetSocketAddress |
localAddress() |
protected SocketAddress |
localAddress0() |
io.netty.channel.ChannelMetadata |
metadata() |
protected io.netty.buffer.ByteBuf |
newDirectBuffer(io.netty.buffer.ByteBuf buf)
Returns an off-heap copy of the specified
ByteBuf , and releases the original one. |
protected io.netty.buffer.ByteBuf |
newDirectBuffer(Object holder,
io.netty.buffer.ByteBuf buf)
Returns an off-heap copy of the specified
ByteBuf , and releases the specified holder. |
protected io.netty.channel.epoll.AbstractEpollChannel.AbstractEpollUnsafe |
newUnsafe() |
io.netty.channel.socket.ServerSocketChannel |
parent() |
InetSocketAddress |
remoteAddress() |
protected SocketAddress |
remoteAddress0() |
io.netty.channel.ChannelFuture |
shutdownOutput() |
io.netty.channel.ChannelFuture |
shutdownOutput(io.netty.channel.ChannelPromise promise) |
EpollTcpInfo |
tcpInfo()
Returns the
TCP_INFO for the current socket. |
EpollTcpInfo |
tcpInfo(EpollTcpInfo info)
Updates and returns the
TCP_INFO for the current socket. |
doClose, doWrite, doWriteSingle, filterOutboundMessage, shutdownOutput0, spliceTo, spliceTo, spliceTo, spliceTo
alloc, bind, bind, close, close, closeFuture, compareTo, connect, connect, connect, connect, deregister, deregister, disconnect, disconnect, equals, eventLoop, flush, hashCode, invalidateLocalAddress, invalidateRemoteAddress, isRegistered, isWritable, newFailedFuture, newProgressivePromise, newPromise, newSucceededFuture, pipeline, read, toString, unsafe, voidPromise, write, write, writeAndFlush, writeAndFlush
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
alloc, bind, bind, close, close, closeFuture, connect, connect, connect, connect, deregister, deregister, disconnect, disconnect, eventLoop, flush, isActive, isOpen, isRegistered, isWritable, metadata, newFailedFuture, newProgressivePromise, newPromise, newSucceededFuture, pipeline, read, unsafe, voidPromise, write, write, writeAndFlush, writeAndFlush
compareTo
public EpollSocketChannel()
@Deprecated public EpollSocketChannel(FileDescriptor fd)
EpollSocketChannel(Socket, boolean)
.public EpollSocketChannel(Socket fd, boolean active)
EpollSocketChannel
from an existing FileDescriptor
.public EpollTcpInfo tcpInfo()
TCP_INFO
for the current socket. See man 7 tcp.public EpollTcpInfo tcpInfo(EpollTcpInfo info)
TCP_INFO
for the current socket.
See man 7 tcp.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
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
protected SocketAddress localAddress0()
localAddress0
in class io.netty.channel.AbstractChannel
protected SocketAddress remoteAddress0()
remoteAddress0
in class io.netty.channel.AbstractChannel
protected void doBind(SocketAddress local) throws Exception
doBind
in class io.netty.channel.AbstractChannel
Exception
public EpollSocketChannelConfig config()
config
in interface io.netty.channel.Channel
config
in interface io.netty.channel.socket.SocketChannel
public boolean isInputShutdown()
isInputShutdown
in interface io.netty.channel.socket.SocketChannel
public boolean isOutputShutdown()
isOutputShutdown
in interface io.netty.channel.socket.SocketChannel
public io.netty.channel.ChannelFuture shutdownOutput()
shutdownOutput
in interface io.netty.channel.socket.SocketChannel
public io.netty.channel.ChannelFuture shutdownOutput(io.netty.channel.ChannelPromise promise)
shutdownOutput
in interface io.netty.channel.socket.SocketChannel
public 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
protected io.netty.channel.epoll.AbstractEpollChannel.AbstractEpollUnsafe newUnsafe()
newUnsafe
in class AbstractEpollStreamChannel
protected boolean doConnect(SocketAddress remoteAddress, SocketAddress localAddress) throws Exception
AbstractEpollStreamChannel
doConnect
in class AbstractEpollStreamChannel
Exception
public final Socket fd()
UnixChannel
FileDescriptor
that is used by this Channel
.fd
in interface UnixChannel
public boolean isActive()
isActive
in interface io.netty.channel.Channel
public io.netty.channel.ChannelMetadata metadata()
metadata
in interface io.netty.channel.Channel
protected void doDisconnect() throws Exception
doDisconnect
in class io.netty.channel.AbstractChannel
Exception
protected boolean isCompatible(io.netty.channel.EventLoop loop)
isCompatible
in class io.netty.channel.AbstractChannel
public boolean isOpen()
isOpen
in interface io.netty.channel.Channel
protected void doDeregister() throws Exception
doDeregister
in class io.netty.channel.AbstractChannel
Exception
protected void doBeginRead() throws Exception
doBeginRead
in class io.netty.channel.AbstractChannel
Exception
protected void doRegister() throws Exception
doRegister
in class io.netty.channel.AbstractChannel
Exception
protected final io.netty.buffer.ByteBuf newDirectBuffer(io.netty.buffer.ByteBuf buf)
ByteBuf
, and releases the original one.protected final io.netty.buffer.ByteBuf newDirectBuffer(Object holder, io.netty.buffer.ByteBuf buf)
ByteBuf
, and releases the specified holder.
The caller must ensure that the holder releases the original ByteBuf
when the holder is released by
this method.protected static void checkResolvable(InetSocketAddress addr)
protected final int doReadBytes(io.netty.buffer.ByteBuf byteBuf) throws Exception
ByteBuf
and return the amount.Exception
Copyright © 2008–2015 The Netty Project. All rights reserved.