- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我们一直在使用netty-handler 4.0.28.Final。我们有一个测试,将无效的 xml 写入测试 channel 。如下所示,将调用 ctx.close() 并触发 ChannelInactive。
@Override
public void exceptionCaught(ChannelHandlerContext ctx, Throwable exc) {
if (connectionListener == null) {
return;
}
// Treat unexpected exceptions as fatal to the connection
try {
connectionListener.connectionError(exc);
} finally {
ctx.close();
}
}
@Override
public void channelInactive(ChannelHandlerContext ctx) throws Exception {
if (connectionListener == null) {
return;
}
connectionListener.connectionClosed();
}
我的任务是将 netty 更新到 netty-all 4.1.11.Final。自更新以来,channelInactive 没有被调用。 (仅当我们在整理期间在 EmbeddedChannel 上调用 finish() 时才会被调用)。
为什么当我们调用 ctx.close() 时,channelInactive 不再被调用?
最佳答案
这是一个错误,将在下一版本中修复。
关于java - 当我在 ChannelHandlerContext 上调用 close() 时,channelInactive() 没有被调用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44701864/
查看代码,似乎不是线程安全的。如果没有,如何以线程安全的方式写入数据? 最佳答案 是的,它是线程安全的。所有ChannelHandlerContext,Channel和ChannelPipeline操
我正在使用 Netty 制作实时游戏,并且我有一个关于在不同于 ChannelHandler 所在线程的 ChannelHandlerContext 上使用 write 方法的问题. 我在 Java
因此,在 Netty 3.x 库中,ChannelHandlerContext 类有一个名为 setAttachment 的方法。不幸的是,它似乎不存在于新的 4.0 库中。我想知道是否有一种方法可以
我正在使用 Netty 4.1.16 创建服务器。我建立了一条管道: socketChannel.pipeline() //Line Based Frame Decoder will
我正在编写客户端-服务器应用程序。我从数据库获取数据并将其放入 rxjava2 的 ReplaySubject (ReplaySubject 是必要的,因为我需要保证每个客户端上的数据相同),当客户端
下面是实现步骤和问题: Netty 服务器处理程序从客户端接收消息 因为有其他正在运行的线程来处理用户数据,所以我们需要把这个请求放到一个队列中,让worker处理 worker处理完数据后,是否可以
我们一直在使用netty-handler 4.0.28.Final。我们有一个测试,将无效的 xml 写入测试 channel 。如下所示,将调用 ctx.close() 并触发 ChannelIna
我使用的是 netty 4.1.50,我想通过用户名来识别连接。 我找到了这个方法(效果很好): @Override public void channelRead(ChannelHandlerCon
ChannelHandler 实现的部分行为是它应该在收到消息后发送响应。但是,传递的 ChannelHandlerContext 似乎确实创建了一个内部 Channel 实例,该实例与单元测试中使用
我是一名优秀的程序员,十分优秀!