Package org.elasticsearch.nio
Class NioServerSocketChannel
java.lang.Object
org.elasticsearch.nio.NioChannel
org.elasticsearch.nio.NioServerSocketChannel
public class NioServerSocketChannel extends NioChannel
-
Constructor Summary
Constructors Constructor Description NioServerSocketChannel(java.nio.channels.ServerSocketChannel serverSocketChannel) -
Method Summary
Modifier and Type Method Description voidaddBindListener(java.util.function.BiConsumer<java.lang.Void,java.lang.Exception> listener)ServerChannelContextgetContext()java.net.InetSocketAddressgetLocalAddress()java.nio.channels.ServerSocketChannelgetRawChannel()voidsetContext(ServerChannelContext context)This method sets the context for a server socket channel.java.lang.StringtoString()
-
Constructor Details
-
NioServerSocketChannel
public NioServerSocketChannel(java.nio.channels.ServerSocketChannel serverSocketChannel)
-
-
Method Details
-
setContext
This method sets the context for a server socket channel. The context is called when a new channel is accepted, an exception occurs, or it is time to close the channel.- Parameters:
context- to call
-
addBindListener
public void addBindListener(java.util.function.BiConsumer<java.lang.Void,java.lang.Exception> listener) -
getLocalAddress
public java.net.InetSocketAddress getLocalAddress()- Specified by:
getLocalAddressin classNioChannel
-
getRawChannel
public java.nio.channels.ServerSocketChannel getRawChannel()- Specified by:
getRawChannelin classNioChannel
-
getContext
- Specified by:
getContextin classNioChannel
-
toString
public java.lang.String toString()- Overrides:
toStringin classjava.lang.Object
-