[
Date Prev][
Date Next][
Thread Prev][
Thread Next][
Date Index][
Thread Index]
[
List Home]
Re: [jetty-users] HTTP/2 max concurrent streams
|
Hi,
On Sun, Oct 18, 2015 at 9:49 AM, Muhui Jiang <jiangmuhui@xxxxxxxxx> wrote:
> Hi,
>
> I want to know how to change the max concurrent streams from the client
> side. I find the default value is 128. I opened the session as follows:
>
> FuturePromise<Session> sessionPromise = new FuturePromise<>();
>
> client.connect(sslContextFactory, new InetSocketAddress(host, port),
>
> new ServerSessionListener.Adapter(), sessionPromise);
This is the client, you should pass just a Session.Listener.Adapter,
but see below.
> Session session = sessionPromise.get(5, TimeUnit.SECONDS);
>
> But it seems there is no method for session to set the maxlocalstream, only
> HTTP/2 session has such a method.
>
> Anyone know how to set the value.
Session.Listener has a method called onPreface() that returns a
Map<Integer, Integer>.
On the client, onPreface() is called before sending the client
preface, so you can return a Map<Integer, Integer> that specifies the
max number of concurrent streams.
Use SettingsFrame.MAX_CONCURRENT_STREAMS as the key for the value you
want to set.
--
Simone Bordet
----
http://cometd.org
http://webtide.com
Developer advice, training, services and support
from the Jetty & CometD experts.