serverfaces
serverfaces

Reputation: 1175

Handling HTTP/2 GOAWAY in okhttp4

I am using okhttp4 4.9.0 to send push notifications to APNs Http/2 server. The call to APNs is synchronous.

The online documentation from Apple has the following:

If APNs decides to terminate an established HTTP/2 connection, it sends a GOAWAY frame

How do I handle this in okhttp4?

try {
    okHttpClient.newCall(request).execute().use { response -> println(response.code)  }
} catch(ioException: IOException) {
    //Is this the place to handle GOAWAY?          
} 

Upvotes: 1

Views: 769

Answers (1)

Jesse Wilson
Jesse Wilson

Reputation: 40623

In practice you'll never need to worry about GOAWAY frames with OkHttp. If one is received it'll just create a new connection on the next request.

Upvotes: 0

Related Questions