Skip to content

Commit

Permalink
NioSelectableChannelIoHandle does not need to get interestedOps as co… (
Browse files Browse the repository at this point in the history
  • Loading branch information
normanmaurer committed Apr 30, 2024
1 parent 596a1f0 commit 24bd56d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ public void run() {
private void register0(final SelectableChannel ch, int interestOps, final NioTask<SelectableChannel> task) {
try {
register(
new NioSelectableChannelIoHandle<SelectableChannel>(ch, interestOps) {
new NioSelectableChannelIoHandle<SelectableChannel>(ch) {
@Override
protected void handle(SelectableChannel channel, SelectionKey key) {
try {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,15 +31,9 @@
*/
public abstract class NioSelectableChannelIoHandle<S extends SelectableChannel> implements IoHandle, NioIoHandle {
private final S channel;
final int interestOps;

public NioSelectableChannelIoHandle(S channel, int interestOps) {
if ((interestOps & ~channel.validOps()) != 0) {
throw new IllegalArgumentException(
"invalid interestOps: " + interestOps + "(validOps: " + channel.validOps() + ')');
}
public NioSelectableChannelIoHandle(S channel) {
this.channel = ObjectUtil.checkNotNull(channel, "channel");
this.interestOps = interestOps;
}

@Override
Expand Down

0 comments on commit 24bd56d

Please sign in to comment.