Class EpollSocketChannel
java.lang.Object
io.netty.util.DefaultAttributeMap
io.netty.channel.AbstractChannel
io.netty.channel.epoll.AbstractEpollChannel
io.netty.channel.epoll.AbstractEpollStreamChannel
io.netty.channel.epoll.EpollSocketChannel
- All Implemented Interfaces:
Channel, ChannelOutboundInvoker, DuplexChannel, SocketChannel, UnixChannel, AttributeMap, Comparable<Channel>
SocketChannel implementation that uses linux EPOLL Edge-Triggered Mode for
maximal performance.-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from class AbstractEpollStreamChannel
AbstractEpollStreamChannel.EpollStreamUnsafe, AbstractEpollStreamChannel.SpliceInTaskNested classes/interfaces inherited from class AbstractEpollChannel
AbstractEpollChannel.AbstractEpollUnsafeNested classes/interfaces inherited from class AbstractChannel
AbstractChannel.AbstractUnsafeNested classes/interfaces inherited from interface Channel
Channel.Unsafe -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final EpollSocketChannelConfigprivate Collection<InetAddress> Fields inherited from class AbstractEpollChannel
active, epollInReadyRunnablePending, flags, inputClosedSeenErrorOnRead, socket -
Constructor Summary
ConstructorsConstructorDescriptionEpollSocketChannel(int fd) EpollSocketChannel(Channel parent, LinuxSocket fd, InetSocketAddress remoteAddress) EpollSocketChannel(LinuxSocket fd, boolean active) EpollSocketChannel(InternetProtocolFamily protocol) -
Method Summary
Modifier and TypeMethodDescriptionconfig()Returns the configuration of this channel.(package private) booleandoConnect0(SocketAddress remote) Returns the local address where this channel is bound to.protected AbstractEpollChannel.AbstractEpollUnsafeCreate a newAbstractChannel.AbstractUnsafeinstance which will be used for the life-time of theChannelparent()Returns the parent of this channel.Returns the remote address where this channel is connected to.(package private) voidsetTcpMd5Sig(Map<InetAddress, byte[]> keys) tcpInfo()Returns theTCP_INFOfor the current socket.tcpInfo(EpollTcpInfo info) Updates and returns theTCP_INFOfor the current socket.Methods inherited from class AbstractEpollStreamChannel
doClose, doShutdownOutput, doWrite, doWriteSingle, filterOutboundMessage, isInputShutdown, isOutputShutdown, isShutdown, metadata, shutdown, shutdown, shutdownInput, shutdownInput, shutdownOutput, shutdownOutput, spliceTo, spliceTo, spliceTo, spliceToMethods inherited from class AbstractEpollChannel
checkResolvable, clearEpollIn, clearFlag, doBeginRead, doBind, doConnect, doDeregister, doDisconnect, doReadBytes, doRegister, doWriteBytes, doWriteOrSendBytes, fd, isActive, isCompatible, isFlagSet, isOpen, isSoErrorZero, localAddress0, newDirectBuffer, newDirectBuffer, remoteAddress0, resetCachedAddresses, setFlag, shouldBreakEpollInReadyMethods inherited from class AbstractChannel
alloc, bind, bind, bytesBeforeUnwritable, bytesBeforeWritable, close, close, closeFuture, compareTo, connect, connect, connect, connect, deregister, deregister, disconnect, disconnect, equals, eventLoop, flush, hashCode, id, invalidateLocalAddress, invalidateRemoteAddress, isRegistered, isWritable, maxMessagesPerWrite, newChannelPipeline, newFailedFuture, newId, newProgressivePromise, newPromise, newSucceededFuture, pipeline, read, toString, unsafe, validateFileRegion, voidPromise, write, write, writeAndFlush, writeAndFlushMethods inherited from class DefaultAttributeMap
attr, hasAttrMethods inherited from interface AttributeMap
attr, hasAttrMethods inherited from interface Channel
alloc, bytesBeforeUnwritable, bytesBeforeWritable, closeFuture, eventLoop, flush, id, isActive, isOpen, isRegistered, isWritable, metadata, pipeline, read, unsafeMethods inherited from interface ChannelOutboundInvoker
bind, bind, close, close, connect, connect, connect, connect, deregister, deregister, disconnect, disconnect, newFailedFuture, newProgressivePromise, newPromise, newSucceededFuture, voidPromise, write, write, writeAndFlush, writeAndFlushMethods inherited from interface Comparable
compareToMethods inherited from interface DuplexChannel
isInputShutdown, isOutputShutdown, isShutdown, shutdown, shutdown, shutdownInput, shutdownInput, shutdownOutput, shutdownOutput
-
Field Details
-
config
-
tcpMd5SigAddresses
-
-
Constructor Details
-
EpollSocketChannel
public EpollSocketChannel() -
EpollSocketChannel
-
EpollSocketChannel
public EpollSocketChannel(int fd) -
EpollSocketChannel
EpollSocketChannel(LinuxSocket fd, boolean active) -
EpollSocketChannel
EpollSocketChannel(Channel parent, LinuxSocket fd, InetSocketAddress remoteAddress)
-
-
Method Details
-
tcpInfo
Returns theTCP_INFOfor the current socket. See man 7 tcp. -
tcpInfo
Updates and returns theTCP_INFOfor the current socket. See man 7 tcp. -
remoteAddress
Description copied from interface:ChannelReturns the remote address where this channel is connected to. The returnedSocketAddressis supposed to be down-cast into more concrete type such asInetSocketAddressto retrieve the detailed information.- Specified by:
remoteAddressin interfaceChannel- Specified by:
remoteAddressin interfaceSocketChannel- Overrides:
remoteAddressin classAbstractChannel- Returns:
- the remote address of this channel.
nullif this channel is not connected. If this channel is not connected but it can receive messages from arbitrary remote addresses (e.g.DatagramChannel, useDefaultAddressedEnvelope.recipient()to determine the origination of the received message as this method will returnnull.
-
localAddress
Description copied from interface:ChannelReturns the local address where this channel is bound to. The returnedSocketAddressis supposed to be down-cast into more concrete type such asInetSocketAddressto retrieve the detailed information.- Specified by:
localAddressin interfaceChannel- Specified by:
localAddressin interfaceSocketChannel- Overrides:
localAddressin classAbstractChannel- Returns:
- the local address of this channel.
nullif this channel is not bound.
-
config
Description copied from interface:ChannelReturns the configuration of this channel.- Specified by:
configin interfaceChannel- Specified by:
configin interfaceSocketChannel- Specified by:
configin classAbstractEpollChannel
-
parent
Description copied from interface:ChannelReturns the parent of this channel.- Specified by:
parentin interfaceChannel- Specified by:
parentin interfaceSocketChannel- Overrides:
parentin classAbstractChannel- Returns:
- the parent channel.
nullif this channel does not have a parent channel.
-
newUnsafe
Description copied from class:AbstractChannelCreate a newAbstractChannel.AbstractUnsafeinstance which will be used for the life-time of theChannel- Overrides:
newUnsafein classAbstractEpollStreamChannel
-
doConnect0
- Overrides:
doConnect0in classAbstractEpollChannel- Throws:
Exception
-
setTcpMd5Sig
- Throws:
IOException
-