This commit is contained in:
@@ -8,6 +8,7 @@ package org.redkale.net;
|
||||
import java.net.*;
|
||||
import java.nio.*;
|
||||
import java.nio.charset.*;
|
||||
import java.util.Collection;
|
||||
import java.util.concurrent.*;
|
||||
import java.util.function.*;
|
||||
import java.util.logging.*;
|
||||
@@ -174,6 +175,13 @@ public class Context {
|
||||
}
|
||||
}
|
||||
|
||||
protected void offerBuffer(Collection<ByteBuffer> buffers) {
|
||||
if (buffers == null) return;
|
||||
for (ByteBuffer buffer : buffers) {
|
||||
bufferPool.accept(buffer);
|
||||
}
|
||||
}
|
||||
|
||||
public Logger getLogger() {
|
||||
return logger;
|
||||
}
|
||||
|
||||
@@ -9,6 +9,7 @@ import java.nio.ByteBuffer;
|
||||
import org.redkale.asm.MethodDebugVisitor;
|
||||
import java.nio.channels.CompletionHandler;
|
||||
import java.security.*;
|
||||
import java.util.Collection;
|
||||
import java.util.concurrent.*;
|
||||
import org.redkale.asm.*;
|
||||
import static org.redkale.asm.Opcodes.*;
|
||||
@@ -58,6 +59,11 @@ public class HttpContext extends Context {
|
||||
super.offerBuffer(buffers);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void offerBuffer(Collection<ByteBuffer> buffers) {
|
||||
super.offerBuffer(buffers);
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
protected <H extends CompletionHandler> Creator<H> loadAsyncHandlerCreator(Class<H> handlerClass) {
|
||||
Creator<H> creator = asyncHandlerCreators.get(handlerClass);
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
package org.redkale.net.sncp;
|
||||
|
||||
import java.nio.ByteBuffer;
|
||||
import java.util.Collection;
|
||||
import org.redkale.net.*;
|
||||
|
||||
/**
|
||||
@@ -30,6 +31,11 @@ public class SncpContext extends Context {
|
||||
super.offerBuffer(buffers);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void offerBuffer(Collection<ByteBuffer> buffers) {
|
||||
super.offerBuffer(buffers);
|
||||
}
|
||||
|
||||
public static class SncpContextConfig extends ContextConfig {
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user