내 질문은 이미 등록 된 채널의 이벤트 교환을 변경하는 것입니다.Netty 4 - 변경하는 채널의 이벤트 루프
채널은 io 이벤트 루프 스레드에 바인딩되어 있으며 서버 보트 트랩에 설정된 EventLoopGroup에서 가져옵니다. 승인. 그러나 "protocol negociation"후에 일부 채널의 io-eventloop을 전용 io-eventloop으로 변경하려고합니다. 그래서 나는 같은 것을 할 :
channel.deregister().addListener(new ChannelFutureListener() {
@Override
public void operationComplete(ChannelFuture future) throws Exception {
newIoLoop.register(future.channel()).sync();
}
});
모든 작업 잘하지만 하나의 질문 : channel.eventloop가 업데이트되고 새로운 ChannelHandlerContext이 eventloop으로 생성됩니다. 그러나 channel.pipeline.head는 여전히 이전 이벤트 루프에 바인딩됩니다. 예상되는 동작입니까?
이 AbstractNioByteChannel.NioByteUnsafe.read 제기 예외()를 생성하는 방법
case 2:
// Let the inbound handler drain the buffer and continue reading.
if (read) {
read = false;
pipeline.fireInboundBufferUpdated(); // event fired in the pipeline to try to read some bytes but without waiting for handler executed in another loop
if (!byteBuf.writable()) { // byteBuf may always be full and exception is raised
throw new IllegalStateException(
"an inbound handler whose buffer is full must consume at " +
"least one byte.");
}
}
내
경우,이 문제를 해결할 것이다 채널 등록을 변경할 때 변경 pipeline.head.eventloop.
고마워요. 버그 리포트 작성 – Totin
... 신고 해 주셔서 감사합니다! –