session.newStream(new HeadersFrame(metaDataA, null, true), new Promise<Stream>()
{
@Override
public void succeeded(Stream stream)
{
// Now we have the streamId.
int streamIdA = stream.getId();
System.out.println(streamIdA);
MetaData.Request metaDataB = new MetaData.Request("GET", new HttpURI("https://"+host+":"+port+"/"+childpath.get(1)), HttpVersion.HTTP_2, requestFields);
session.newStream(new HeadersFrame(metaDataB, new
PriorityFrame(streamIdA, 1, false), true), new
Promise.Adapter<>(), new Stream.Listener.Adapter() );
MetaData.Request metaDataC = new MetaData.Request("GET", new HttpURI("https://"+host+":"+port+"/"+childpath.get(2)), HttpVersion.HTTP_2, requestFields);
session.newStream(new HeadersFrame(metaDataC, new
PriorityFrame(streamIdA, 256, true), true), new
Promise.Adapter<>(), new Stream.Listener.Adapter() );
MetaData.Request metaDataD = new MetaData.Request("GET", new HttpURI("https://"+host+":"+port+"/"+childpath.get(3)), HttpVersion.HTTP_2, requestFields);
session.newStream(new HeadersFrame(metaDataD, new
PriorityFrame(streamIdA, 1, false), true), new
Promise.Adapter<>(), new Stream.Listener.Adapter() );
}
@Override
public void failed(Throwable x) {
// TODO Auto-generated method stub
}
}, new Stream.Listener.Adapter()
);
Weights and exclusive has no influence on the results. My server logs keeps this order
127.0.0.1 - - [18/Sep/2015:14:48:22 +0800] "GET /index.html HTTP/2" 200 8215 "-" "org.eclipse.jetty.http2.client.HTTP2Client/9.3.4-SNAPSHOT"
127.0.0.1 - - [18/Sep/2015:14:48:22 +0800] "GET /css/infocard.css HTTP/2" 200 2800 "-" "org.eclipse.jetty.http2.client.HTTP2Client/9.3.4-SNAPSHOT"
127.0.0.1 - - [18/Sep/2015:14:48:22 +0800] "GET /js/preloadjs.min.js HTTP/2" 200 30839 "-" "org.eclipse.jetty.http2.client.HTTP2Client/9.3.4-SNAPSHOT"
127.0.0.1 - - [18/Sep/2015:14:48:22 +0800] "GET /img/clink/clinklittle128.png HTTP/2" 200 2318863 "-" "org.eclipse.jetty.http2.client.HTTP2Client/9.3.4-SNAPSHOT"
Do you know why?
Best Regards
Muhui Jiang