Allow to obtain the Worker that was used to serve the IO of a Channel
This commit is contained in:
parent
e0e87ce2bc
commit
bc47850bbe
@ -115,6 +115,16 @@ abstract class AbstractNioChannel<C extends SelectableChannel & WritableByteChan
|
||||
this.channel = ch;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the {@link AbstractNioWorker} that handle the IO of the {@link AbstractNioChannel}
|
||||
*
|
||||
* @return worker
|
||||
*/
|
||||
public AbstractNioWorker getWorker() {
|
||||
return worker;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public InetSocketAddress getLocalAddress() {
|
||||
InetSocketAddress localAddress = this.localAddress;
|
||||
|
@ -66,6 +66,11 @@ final class NioDatagramChannel extends AbstractNioChannel<DatagramChannel>
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public NioDatagramWorker getWorker() {
|
||||
return (NioDatagramWorker) super.getWorker();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isBound() {
|
||||
return isOpen() && channel.socket().isBound();
|
||||
|
@ -43,6 +43,11 @@ class NioSocketChannel extends AbstractNioChannel<SocketChannel>
|
||||
config = new DefaultNioSocketChannelConfig(socket.socket());
|
||||
}
|
||||
|
||||
@Override
|
||||
public NioWorker getWorker() {
|
||||
return (NioWorker) super.getWorker();
|
||||
}
|
||||
|
||||
@Override
|
||||
public NioSocketChannelConfig getConfig() {
|
||||
return config;
|
||||
|
Loading…
Reference in New Issue
Block a user