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;
|
this.channel = ch;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Return the {@link AbstractNioWorker} that handle the IO of the {@link AbstractNioChannel}
|
||||||
|
*
|
||||||
|
* @return worker
|
||||||
|
*/
|
||||||
|
public AbstractNioWorker getWorker() {
|
||||||
|
return worker;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public InetSocketAddress getLocalAddress() {
|
public InetSocketAddress getLocalAddress() {
|
||||||
InetSocketAddress localAddress = this.localAddress;
|
InetSocketAddress localAddress = this.localAddress;
|
||||||
|
@ -66,6 +66,11 @@ final class NioDatagramChannel extends AbstractNioChannel<DatagramChannel>
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public NioDatagramWorker getWorker() {
|
||||||
|
return (NioDatagramWorker) super.getWorker();
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isBound() {
|
public boolean isBound() {
|
||||||
return isOpen() && channel.socket().isBound();
|
return isOpen() && channel.socket().isBound();
|
||||||
|
@ -43,6 +43,11 @@ class NioSocketChannel extends AbstractNioChannel<SocketChannel>
|
|||||||
config = new DefaultNioSocketChannelConfig(socket.socket());
|
config = new DefaultNioSocketChannelConfig(socket.socket());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public NioWorker getWorker() {
|
||||||
|
return (NioWorker) super.getWorker();
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public NioSocketChannelConfig getConfig() {
|
public NioSocketChannelConfig getConfig() {
|
||||||
return config;
|
return config;
|
||||||
|
Loading…
Reference in New Issue
Block a user