|
@@ -16,10 +16,6 @@ import org.smartboot.http.server.HttpRequest;
|
|
|
import org.smartboot.http.server.HttpResponse;
|
|
|
import org.smartboot.http.server.HttpServerHandler;
|
|
|
import org.smartboot.http.server.handler.HttpRouteHandler;
|
|
|
-import org.smartboot.http.server.impl.Request;
|
|
|
-import org.smartboot.socket.StateMachineEnum;
|
|
|
-import org.smartboot.socket.extension.processor.AbstractMessageProcessor;
|
|
|
-import org.smartboot.socket.transport.AioSession;
|
|
|
|
|
|
import javax.sql.DataSource;
|
|
|
import java.io.IOException;
|
|
@@ -55,22 +51,10 @@ public class Bootstrap {
|
|
|
HttpBootstrap bootstrap = new HttpBootstrap();
|
|
|
bootstrap.configuration()
|
|
|
.threadNum(cpuNum)
|
|
|
- .headerLimiter(0)
|
|
|
.readBufferSize(1024 * 4)
|
|
|
.writeBufferSize(1024 * 4)
|
|
|
.readMemoryPool(16384 * 1024 * 4)
|
|
|
- .writeMemoryPool(10 * 1024 * 1024 * cpuNum, cpuNum)
|
|
|
- .messageProcessor(processor -> new AbstractMessageProcessor<>() {
|
|
|
- @Override
|
|
|
- public void process0(AioSession session, Request msg) {
|
|
|
- processor.process(session, msg);
|
|
|
- }
|
|
|
-
|
|
|
- @Override
|
|
|
- public void stateEvent0(AioSession session, StateMachineEnum stateMachineEnum, Throwable throwable) {
|
|
|
- processor.stateEvent(session, stateMachineEnum, throwable);
|
|
|
- }
|
|
|
- });
|
|
|
+ .writeMemoryPool(10 * 1024 * 1024 * cpuNum, cpuNum);
|
|
|
bootstrap.httpHandler(routeHandle).setPort(8080).start();
|
|
|
}
|
|
|
|