Skip to content

Commit 70ed781

Browse files
committed
[fix] update HttpServerHandler
1 parent 5851121 commit 70ed781

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

src/main/java/com/github/gcnyin/rawnio/eventloop/SocketEventLoop.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
import com.github.gcnyin.rawnio.logging.Logger;
44
import com.github.gcnyin.rawnio.logging.LoggerFactory;
55
import com.github.gcnyin.rawnio.objectpool.ByteBufferPool;
6-
import lombok.Setter;
76

87
import java.io.IOException;
98
import java.nio.channels.SelectionKey;
@@ -19,7 +18,6 @@ public class SocketEventLoop {
1918
private static final Logger log = LoggerFactory.getLogger(SocketEventLoop.class);
2019

2120
private final Selector selector;
22-
@Setter
2321
private SocketHandlerProvider socketHandlerProvider;
2422
private final CountDownLatch countDownLatch;
2523
private final ByteBufferPool byteBufferPool = new ByteBufferPool();
@@ -79,4 +77,8 @@ public CompletableFuture<String> loop() {
7977
future.complete("interrupted");
8078
return future;
8179
}
80+
81+
public void setSocketHandlerProvider(SocketHandlerProvider socketHandlerProvider) {
82+
this.socketHandlerProvider = socketHandlerProvider;
83+
}
8284
}

src/main/java/com/github/gcnyin/rawnio/http1/HttpServerHandler.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@ public void onRead() throws IOException {
4141
log.info(response.toString());
4242
ByteBuffer buffer = ByteBuffer.wrap(response.getBytes());
4343
ctx.getSocketChannel().write(buffer);
44-
ctx.getSelectionKey().interestOps(SelectionKey.OP_WRITE);
4544
}
4645

4746
private HttpResponse handle(HttpRequest request) {

0 commit comments

Comments
 (0)