Do not auto-start read operation
This commit is contained in:
parent
103edc4467
commit
923dde7a5f
@ -153,7 +153,6 @@ public final class NioDatagramChannel
|
||||
@Override
|
||||
protected void doBind(SocketAddress localAddress) throws Exception {
|
||||
javaChannel().socket().bind(localAddress);
|
||||
selectionKey().interestOps(SelectionKey.OP_READ);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -166,7 +165,6 @@ public final class NioDatagramChannel
|
||||
boolean success = false;
|
||||
try {
|
||||
javaChannel().connect(remoteAddress);
|
||||
selectionKey().interestOps(selectionKey().interestOps() | SelectionKey.OP_READ);
|
||||
success = true;
|
||||
return true;
|
||||
} finally {
|
||||
|
@ -211,9 +211,7 @@ public class NioSctpChannel extends AbstractNioMessageChannel implements io.nett
|
||||
boolean success = false;
|
||||
try {
|
||||
boolean connected = javaChannel().connect(remoteAddress);
|
||||
if (connected) {
|
||||
selectionKey().interestOps(SelectionKey.OP_READ);
|
||||
} else {
|
||||
if (!connected) {
|
||||
selectionKey().interestOps(SelectionKey.OP_CONNECT);
|
||||
}
|
||||
success = true;
|
||||
@ -230,7 +228,6 @@ public class NioSctpChannel extends AbstractNioMessageChannel implements io.nett
|
||||
if (!javaChannel().finishConnect()) {
|
||||
throw new Error();
|
||||
}
|
||||
selectionKey().interestOps(SelectionKey.OP_READ);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -174,9 +174,7 @@ public class NioSocketChannel extends AbstractNioByteChannel implements io.netty
|
||||
boolean success = false;
|
||||
try {
|
||||
boolean connected = javaChannel().connect(remoteAddress);
|
||||
if (connected) {
|
||||
selectionKey().interestOps(SelectionKey.OP_READ);
|
||||
} else {
|
||||
if (!connected) {
|
||||
selectionKey().interestOps(SelectionKey.OP_CONNECT);
|
||||
}
|
||||
success = true;
|
||||
@ -193,7 +191,6 @@ public class NioSocketChannel extends AbstractNioByteChannel implements io.netty
|
||||
if (!javaChannel().finishConnect()) {
|
||||
throw new Error();
|
||||
}
|
||||
selectionKey().interestOps(SelectionKey.OP_READ);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
Loading…
Reference in New Issue
Block a user