[#2326] Add constructor to NioServerSocketChannel which accepts a ServerSocketChannel
Motivation: Allow the user to create a NioServerSocketChannel from an existing ServerSocketChannel. Modifications: Add an extra constructor Result: Now the user is be able to create a NioServerSocketChannel from an existing ServerSocketChannel, like he can do with all the other Nio*Channel implemntations.
This commit is contained in:
parent
ba201f61ea
commit
4e2bc95ef9
@ -68,7 +68,14 @@ public class NioServerSocketChannel extends AbstractNioMessageServerChannel
|
|||||||
* Create a new instance
|
* Create a new instance
|
||||||
*/
|
*/
|
||||||
public NioServerSocketChannel(EventLoop eventLoop, EventLoopGroup childGroup) {
|
public NioServerSocketChannel(EventLoop eventLoop, EventLoopGroup childGroup) {
|
||||||
super(null, eventLoop, childGroup, newSocket(), SelectionKey.OP_ACCEPT);
|
this(eventLoop, childGroup, newSocket());
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Create a new instance using the given {@link ServerSocketChannel}.
|
||||||
|
*/
|
||||||
|
public NioServerSocketChannel(EventLoop eventLoop, EventLoopGroup childGroup, ServerSocketChannel channel) {
|
||||||
|
super(null, eventLoop, childGroup, channel, SelectionKey.OP_ACCEPT);
|
||||||
config = new DefaultServerSocketChannelConfig(this, javaChannel().socket());
|
config = new DefaultServerSocketChannelConfig(this, javaChannel().socket());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user