【发布时间】:2021-03-21 08:15:29
【问题描述】:
我正在使用okhttp4 4.9.0 向 APNs Http/2 服务器发送推送通知。
对APNs 的调用是同步的。
Apple 的在线文档有以下内容:
如果 APNs 决定终止已建立的 HTTP/2 连接,它 发送 GOAWAY 帧
如何在 okhttp4 中处理这个问题?
try {
okHttpClient.newCall(request).execute().use { response -> println(response.code) }
} catch(ioException: IOException) {
//Is this the place to handle GOAWAY?
}
【问题讨论】: