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