netty - Netty http/2 编解码器的 ReadTimeoutHandler
问题描述
有什么方法可以找出stream
当前的 http/2 请求吗?我想给netty设置readtimeout,很明显的方法就是ReadTimeoutHandler。
在我的服务器初始化程序中,我这样做:
ch.pipeline().addLast(
new ReadTimeoutHandler(10), // here
ssl.newHandler(ch.alloc()),
new MyHandler()
)
然后在 MyHandler 中,我想向用户发送关于请求问题的 http/2 请求。
// class MyHandler
public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) {
// send timeout response
}
但是为了发送 http/2 响应,我需要一个流 id。我有能力找出这个标识符吗?
解决方案
推荐阅读
- java - 子字段上的 GraphQL 参数
- css - 仅当屏幕高度足够时 Flexbox 垂直居中
- javascript - ERROR 错误:未捕获(在承诺中):错误:调用 getActive 时必需的参数参与者 ID 为空或未定义
- neural-network - 使用 BertForTokenClassification 模型预测 NER
- android - Android Studio中SETAFFINITY ret = -1是什么意思?这是我的活动日志
- java - 基于java中的用户输入更新数据库
- javascript - -[object Object]- Google 距离矩阵上的错误 - Android 和 iOS
- ios - Hyperledger Indy iOS sdk 无法导入钱包
- xml - Golang XML 编码
- java - 如何在后台和前台运行一个函数 Android Studio(JAVA)