TcpChannelFactorypublic abstract class ChannelFactory<ServerSocket extends NioServerSocketChannel,Socket extends NioSocketChannel>
extends java.lang.Object
| Modifier and Type | Method | Description |
|---|---|---|
Socket |
acceptNioChannel(NioServerSocketChannel serverChannel,
SocketSelector selector) |
|
abstract Socket |
createChannel(SocketSelector selector,
java.nio.channels.SocketChannel channel) |
This method should return a new
NioSocketChannel implementation. |
abstract ServerSocket |
createServerChannel(AcceptingSelector selector,
java.nio.channels.ServerSocketChannel channel) |
This method should return a new
NioServerSocketChannel implementation. |
Socket |
openNioChannel(java.net.InetSocketAddress remoteAddress,
SocketSelector selector) |
|
ServerSocket |
openNioServerSocketChannel(java.net.InetSocketAddress address,
AcceptingSelector selector) |
public Socket openNioChannel(java.net.InetSocketAddress remoteAddress, SocketSelector selector) throws java.io.IOException
java.io.IOExceptionpublic Socket acceptNioChannel(NioServerSocketChannel serverChannel, SocketSelector selector) throws java.io.IOException
java.io.IOExceptionpublic ServerSocket openNioServerSocketChannel(java.net.InetSocketAddress address, AcceptingSelector selector) throws java.io.IOException
java.io.IOExceptionpublic abstract Socket createChannel(SocketSelector selector, java.nio.channels.SocketChannel channel) throws java.io.IOException
NioSocketChannel implementation. When this method has
returned, the channel should be fully created and setup. Read and write contexts and the channel
exception handler should have been set.selector - the channel will be registered withchannel - the raw channeljava.io.IOException - related to the creation of the channelpublic abstract ServerSocket createServerChannel(AcceptingSelector selector, java.nio.channels.ServerSocketChannel channel) throws java.io.IOException
NioServerSocketChannel implementation. When this method has
returned, the channel should be fully created and setup.selector - the channel will be registered withchannel - the raw channeljava.io.IOException - related to the creation of the channel