Skip to content

Commit 5fb52ac

Browse files
committed
Implemented Undertow
1 parent 0c5b8f4 commit 5fb52ac

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/main/java/org/javawebstack/httpserver/adapter/untertow/UndertowHTTPSocket.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
package org.javawebstack.httpserver.adapter.untertow;
22

3+
import io.undertow.server.BlockingHttpExchange;
34
import io.undertow.server.HttpServerExchange;
45
import io.undertow.util.HeaderValues;
56
import io.undertow.util.HttpString;
@@ -16,9 +17,11 @@
1617
public class UndertowHTTPSocket implements IHTTPSocket {
1718

1819
private final HttpServerExchange exchange;
20+
private final BlockingHttpExchange blockingExchange;
1921

2022
public UndertowHTTPSocket(HttpServerExchange exchange) {
2123
this.exchange = exchange;
24+
this.blockingExchange = exchange.startBlocking();
2225
}
2326

2427
public InputStream getInputStream() throws IOException {
@@ -30,6 +33,7 @@ public OutputStream getOutputStream() throws IOException {
3033
}
3134

3235
public void close() throws IOException {
36+
blockingExchange.close();
3337
exchange.endExchange();
3438
}
3539

0 commit comments

Comments
 (0)