This commit is contained in:
Redkale
2018-12-17 10:56:00 +08:00
parent f9d250b43c
commit 2f89778fd6
3 changed files with 20 additions and 0 deletions

View File

@@ -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;
}

View File

@@ -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);

View File

@@ -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 {
}