Skip to content

Commit 3daeb73

Browse files
committed
update t-io version to 3.8.6.v20240801-RELEASE
1 parent c588c09 commit 3daeb73

File tree

4 files changed

+13
-7
lines changed

4 files changed

+13
-7
lines changed

frameworks/Java/t-io/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ These implementations use the t-io's controller.
1010

1111

1212
## Versions
13-
3.5.5.v20191010-RELEASE (https://gitee.com/tywo45/t-io)
13+
3.8.6.v20240801-RELEASE (https://gitee.com/tywo45/t-io)
1414

1515
## Test URLs
1616

frameworks/Java/t-io/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
<parent>
99
<groupId>org.t-io</groupId>
1010
<artifactId>tio-http-parent</artifactId>
11-
<version>3.5.5.v20191010-RELEASE</version>
11+
<version>3.8.6.v20240801-RELEASE</version>
1212
</parent>
1313

1414
<properties>

frameworks/Java/t-io/src/main/java/org/tio/http/server/benchmark/TioBenchmarkStarter.java

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,13 @@
22

33
import java.io.IOException;
44

5+
import org.tio.core.PacketHandlerMode;
56
import org.tio.http.common.HttpConfig;
67
import org.tio.http.server.HttpServerStarter;
78
import org.tio.http.server.benchmark.controller.TestController;
89
import org.tio.http.server.handler.DefaultHttpRequestHandler;
910
import org.tio.http.server.mvc.Routes;
10-
import org.tio.server.ServerTioConfig;
11+
import org.tio.server.TioServerConfig;
1112

1213
/**
1314
* @author tanyaowu
@@ -17,7 +18,7 @@ public class TioBenchmarkStarter {
1718
public static HttpConfig httpConfig;
1819
public static DefaultHttpRequestHandler requestHandler;
1920
public static HttpServerStarter httpServerStarter;
20-
public static ServerTioConfig serverTioConfig;
21+
public static TioServerConfig tioServerConfig;
2122

2223
/**
2324
* @param args
@@ -36,8 +37,11 @@ public static void main(String[] args) throws Exception {
3637
requestHandler = new DefaultHttpRequestHandler(httpConfig, routes);
3738
requestHandler.setCompatibilityAssignment(false);
3839
httpServerStarter = new HttpServerStarter(httpConfig, requestHandler);
39-
serverTioConfig = httpServerStarter.getServerTioConfig();
40-
serverTioConfig.statOn = false;
40+
tioServerConfig = httpServerStarter.getTioServerConfig();
41+
tioServerConfig.setUseQueueDecode(false);
42+
tioServerConfig.setPacketHandlerMode(PacketHandlerMode.SINGLE_THREAD);
43+
tioServerConfig.setUseQueueSend(false);
44+
tioServerConfig.statOn = false;
4145
httpServerStarter.start();
4246
}
4347
}

frameworks/Java/t-io/src/main/java/org/tio/http/server/benchmark/controller/TestController.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,14 @@ public class TestController {
2020
private static final String HELLO_WORLD = "Hello, World!";
2121

2222
private static final byte[] HELLO_WORLD_BYTES = HELLO_WORLD.getBytes();
23+
24+
private static final Message MESSAGE = new Message(HELLO_WORLD);
2325

2426
@RequestPath(value = "json")
2527
public HttpResponse json(HttpRequest request) throws Exception {
2628
//更高性能的写法
2729
HttpResponse ret = new HttpResponse(request);
28-
ret.setBody(Json.toJson(new Message(HELLO_WORLD)).getBytes());
30+
ret.setBody(Json.toJson(MESSAGE).getBytes());
2931
ret.addHeader(HeaderName.Content_Type, HeaderValue.Content_Type.TEXT_PLAIN_JSON);
3032
return ret;
3133

0 commit comments

Comments
 (0)