This commit is contained in:
@@ -18,7 +18,6 @@ import org.redkale.net.AsyncConnection;
|
||||
import org.redkale.net.nio.NioCompletionHandler;
|
||||
import org.redkale.net.nio.NioThread;
|
||||
import org.redkale.net.nio.NioThreadGroup;
|
||||
import org.redkale.util.ObjectPool;
|
||||
|
||||
/**
|
||||
*
|
||||
@@ -81,9 +80,9 @@ public class TcpNioAsyncConnection extends AsyncConnection {
|
||||
private SelectionKey writeKey;
|
||||
|
||||
public TcpNioAsyncConnection(NioThreadGroup ioGroup, NioThread ioThread, ExecutorService workExecutor,
|
||||
ObjectPool<ByteBuffer> bufferPool, SocketChannel ch,
|
||||
SocketChannel ch,
|
||||
SSLContext sslContext, final SocketAddress addr0, AtomicLong livingCounter, AtomicLong closedCounter) {
|
||||
super(bufferPool, sslContext, livingCounter, closedCounter);
|
||||
super(ioThread.getBufferPool(), sslContext, livingCounter, closedCounter);
|
||||
this.ioGroup = ioGroup;
|
||||
this.ioThread = ioThread;
|
||||
this.workExecutor = workExecutor;
|
||||
|
||||
@@ -129,7 +129,7 @@ public class TcpNioProtocolServer extends ProtocolServer {
|
||||
channel.setOption(StandardSocketOptions.SO_RCVBUF, 16 * 1024);
|
||||
channel.setOption(StandardSocketOptions.SO_SNDBUF, 16 * 1024);
|
||||
NioThread ioThread = ioGroup.nextThread();
|
||||
AsyncConnection conn = new TcpNioAsyncConnection(ioGroup, ioThread, context.executor, bufferPool, channel, context.getSSLContext(), null, livingCounter, closedCounter);
|
||||
AsyncConnection conn = new TcpNioAsyncConnection(ioGroup, ioThread, context.executor, channel, context.getSSLContext(), null, livingCounter, closedCounter);
|
||||
new PrepareRunner(context, responsePool, conn, null, null).run();
|
||||
}
|
||||
|
||||
|
||||
@@ -50,6 +50,10 @@ public class NioThread extends Thread {
|
||||
selector.wakeup();
|
||||
}
|
||||
|
||||
public ObjectPool<ByteBuffer> getBufferPool() {
|
||||
return bufferPool;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
this.localThread = Thread.currentThread();
|
||||
|
||||
Reference in New Issue
Block a user