AsyncConnection
This commit is contained in:
@@ -289,28 +289,6 @@ public abstract class AsyncConnection implements Channel, AutoCloseable {
|
||||
}
|
||||
}
|
||||
|
||||
public final void readRegisterInIOThread(CompletionHandler<Integer, ByteBuffer> handler) {
|
||||
if (inCurrReadThread()) {
|
||||
readRegister(handler);
|
||||
} else {
|
||||
executeRead(() -> readRegister(handler));
|
||||
}
|
||||
}
|
||||
|
||||
public final void readRegisterInIOThreadSafe(CompletionHandler<Integer, ByteBuffer> handler) {
|
||||
if (inCurrReadThread()) {
|
||||
if (!readPending) {
|
||||
readRegister(handler);
|
||||
}
|
||||
} else {
|
||||
executeRead(() -> {
|
||||
if (!readPending) {
|
||||
readRegister(handler);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
public final void read(CompletionHandler<Integer, ByteBuffer> handler) {
|
||||
if (sslEngine == null) {
|
||||
readImpl(handler);
|
||||
@@ -327,20 +305,6 @@ public abstract class AsyncConnection implements Channel, AutoCloseable {
|
||||
}
|
||||
}
|
||||
|
||||
public final void readInIOThreadSafe(CompletionHandler<Integer, ByteBuffer> handler) {
|
||||
if (inCurrReadThread()) {
|
||||
if (!readPending) {
|
||||
read(handler);
|
||||
}
|
||||
} else {
|
||||
executeRead(() -> {
|
||||
if (!readPending) {
|
||||
read(handler);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
// src写完才会回调
|
||||
public final <A> void write(ByteBuffer src, A attachment, CompletionHandler<Integer, ? super A> handler) {
|
||||
if (sslEngine == null) {
|
||||
|
||||
Reference in New Issue
Block a user