Skip to content

Commit 5a0c0b7

Browse files
smthingNateBrady23
authored andcommitted
update to 1.0.1 (#4014)
* smart-socket 1.0 * smart-socket 1.0 * smart-socket 1.0.1 * smart-socket 1.0.1 * smart-socket 1.0.1
1 parent 1560e25 commit 5a0c0b7

File tree

3 files changed

+12
-13
lines changed

3 files changed

+12
-13
lines changed

frameworks/Java/smart-socket/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
<parent>
1010
<groupId>org.smartboot.http</groupId>
1111
<artifactId>smart-http-parent</artifactId>
12-
<version>1.0.0</version>
12+
<version>1.0.1</version>
1313
</parent>
1414
<properties>
1515
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>

frameworks/Java/smart-socket/smart-socket.dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,4 @@ RUN mvn compile assembly:single
77
FROM openjdk:10-jre-slim
88
WORKDIR /smart-socket
99
COPY --from=maven /smart-socket/target/smart-socket-benchmark-1.0-jar-with-dependencies.jar app.jar
10-
CMD ["java", "-server", "-XX:+UseNUMA", "-XX:+UseParallelGC", "-XX:+AggressiveOpts", "-cp", "app.jar", "org.smartboot.http.HttpBootstrap"]
10+
CMD ["java", "-server", "-XX:+UseNUMA", "-XX:+UseParallelGC", "-XX:+AggressiveOpts", "-cp", "app.jar", "org.smartboot.http.Bootstrap"]

frameworks/Java/smart-socket/src/main/java/org/smartboot/http/HttpBootstrap.java renamed to frameworks/Java/smart-socket/src/main/java/org/smartboot/http/Bootstrap.java

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -8,26 +8,26 @@
88

99
package org.smartboot.http;
1010

11-
import org.smartboot.http.common.HttpEntityV2;
12-
import org.smartboot.http.common.HttpRequestProtocol;
13-
import org.smartboot.http.common.utils.HttpHeaderConstant;
1411
import org.smartboot.http.server.handle.HttpHandle;
15-
import org.smartboot.http.server.http11.HttpResponse;
12+
import org.smartboot.http.server.v1.HttpMessageProcessor;
13+
import org.smartboot.http.server.v1.decode.HttpEntity;
14+
import org.smartboot.http.server.v1.decode.HttpRequestProtocol;
15+
import org.smartboot.http.utils.HttpHeaderConstant;
1616
import org.smartboot.socket.MessageProcessor;
1717
import org.smartboot.socket.transport.AioQuickServer;
1818

1919
import java.io.IOException;
2020

21-
public class HttpBootstrap {
21+
public class Bootstrap {
2222
static byte[] body = "Hello, World!".getBytes();
2323

2424
public static void main(String[] args) {
25-
org.smartboot.http.server.HttpV2MessageProcessor processor = new org.smartboot.http.server.HttpV2MessageProcessor(System.getProperty("webapps.dir", "./"));
25+
HttpMessageProcessor processor = new HttpMessageProcessor(System.getProperty("webapps.dir", "./"));
2626
processor.route("/plaintext", new HttpHandle() {
2727

2828

2929
@Override
30-
public void doHandle(HttpEntityV2 request, HttpResponse response) throws IOException {
30+
public void doHandle(HttpRequest request, HttpResponse response) throws IOException {
3131

3232
response.setHeader(HttpHeaderConstant.Names.CONTENT_LENGTH, body.length + "");
3333
response.setHeader(HttpHeaderConstant.Names.CONTENT_TYPE, "text/plain; charset=UTF-8");
@@ -36,7 +36,7 @@ public void doHandle(HttpEntityV2 request, HttpResponse response) throws IOExcep
3636
});
3737
processor.route("/json", new HttpHandle() {
3838
@Override
39-
public void doHandle(HttpEntityV2 request, HttpResponse response) throws IOException {
39+
public void doHandle(HttpRequest request, HttpResponse response) throws IOException {
4040
byte[] b = JSON.toJson(new Message("Hello, World!"));
4141
response.setHeader(HttpHeaderConstant.Names.CONTENT_LENGTH, b.length + "");
4242
response.setHeader(HttpHeaderConstant.Names.CONTENT_TYPE, "application/json");
@@ -47,12 +47,11 @@ public void doHandle(HttpEntityV2 request, HttpResponse response) throws IOExcep
4747
// https(processor);
4848
}
4949

50-
public static void http(MessageProcessor<org.smartboot.http.common.HttpEntityV2> processor) {
50+
public static void http(MessageProcessor<HttpEntity> processor) {
5151
// 定义服务器接受的消息类型以及各类消息对应的处理器
52-
AioQuickServer<org.smartboot.http.common.HttpEntityV2> server = new AioQuickServer<org.smartboot.http.common.HttpEntityV2>(8080, new HttpRequestProtocol(), processor);
52+
AioQuickServer<HttpEntity> server = new AioQuickServer<>(8080, new HttpRequestProtocol(), processor);
5353
server.setWriteQueueSize(4);
5454
server.setReadBufferSize(1024);
55-
// server.setThreadNum(8);
5655
try {
5756
server.start();
5857
} catch (IOException e) {

0 commit comments

Comments
 (0)