Observe MAX_CONCURRENT_STREAMS in OkHttp client
We ignore it. We shouldn't.
Do you want me to pick this up?
Sure.
In order to do this, we need the access to Settings, either wait for OkHttp's change, https://github.com/square/okhttp/issues/32, or we just hack it by adding a class in our code base but in package com.squareup.okhttp.internal.spdy, if we go the later way, I'm worrying about the difficulty of sync with our internal version.
@madongfly, no, that OkHttp issue is about something different that isn't part of the HTTP/2 spec any more.
We need to remember the MAX_CONCURRENT_STREAMS at OkHttpClientTransport.settings and make sure not to exceed the number of streams in OkHttpClientTransport.newStream.
@ejona86, I meant the general idea of "Better support for SETTINGS", currently we can't config/read the Settings.
@madongfly, that OkHttp issue is for making SETTINGS durable. That is, to save them on disk like is done with cookies and caches. That feature is no longer part of the HTTP/2 spec and so is no longer appropriate for discussion.
We can receive the settings when the server sends them, in OkHttpClientTransport.settings(), which I linked to. Why do you think we can't config/read the settings?
Because the necessary field/methods are package private.
On Fri, Apr 3, 2015 at 9:08 AM, Eric Anderson [email protected] wrote:
@madongfly https://github.com/madongfly, that OkHttp issue is for making SETTINGS durable. That is, to save them on disk like is done with cookies and caches. That feature is no longer part of the HTTP/2 spec and so is no longer appropriate for discussion.
We can receive the settings when the server sends them, in OkHttpClientTransport.settings(), which I linked to. Why do you think we can't config/read the settings?
— Reply to this email directly or view it on GitHub https://github.com/grpc/grpc-java/issues/181#issuecomment-89103091.
Ah, I see. Yeah, I don't think we're going to get that changed. We should create a utility class in the appropriate package and call it to get the information we need:
package com.squareup.okhttp.internal.spdy;
public class MakeItPublicUtility {
public static final int MAX_CONCURRENT_STREAMS = Settings.MAX_CONCURRENT_STREAMS;
public static boolean isSet(Settings settings, int id) {
return settings.isSet(id);
}
public static int get(Settings settings, int id) {
return settings.get(id);
}
}
Yeah, that's the 2nd option I mentioned, we can go this way.
This was fixed by #269