File tree Expand file tree Collapse file tree 2 files changed +4
-3
lines changed
src/main/java/com/github/gcnyin/rawnio Expand file tree Collapse file tree 2 files changed +4
-3
lines changed Original file line number Diff line number Diff line change 3
3
import com .github .gcnyin .rawnio .logging .Logger ;
4
4
import com .github .gcnyin .rawnio .logging .LoggerFactory ;
5
5
import com .github .gcnyin .rawnio .objectpool .ByteBufferPool ;
6
- import lombok .Setter ;
7
6
8
7
import java .io .IOException ;
9
8
import java .nio .channels .SelectionKey ;
@@ -19,7 +18,6 @@ public class SocketEventLoop {
19
18
private static final Logger log = LoggerFactory .getLogger (SocketEventLoop .class );
20
19
21
20
private final Selector selector ;
22
- @ Setter
23
21
private SocketHandlerProvider socketHandlerProvider ;
24
22
private final CountDownLatch countDownLatch ;
25
23
private final ByteBufferPool byteBufferPool = new ByteBufferPool ();
@@ -79,4 +77,8 @@ public CompletableFuture<String> loop() {
79
77
future .complete ("interrupted" );
80
78
return future ;
81
79
}
80
+
81
+ public void setSocketHandlerProvider (SocketHandlerProvider socketHandlerProvider ) {
82
+ this .socketHandlerProvider = socketHandlerProvider ;
83
+ }
82
84
}
Original file line number Diff line number Diff line change @@ -41,7 +41,6 @@ public void onRead() throws IOException {
41
41
log .info (response .toString ());
42
42
ByteBuffer buffer = ByteBuffer .wrap (response .getBytes ());
43
43
ctx .getSocketChannel ().write (buffer );
44
- ctx .getSelectionKey ().interestOps (SelectionKey .OP_WRITE );
45
44
}
46
45
47
46
private HttpResponse handle (HttpRequest request ) {
You can’t perform that action at this time.
0 commit comments