Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [jetty-users] Continuation Frame


I send it in this way, but it cannot guarantee the continuation frame is sent in the specific stream and session or using the http2 protocol. Am I right? 

SocketChannel socketChannel =;

socketChannel.connect(new InetSocketAddress("", 443));

for (ByteBuffer buffer : buffers)





And Also java will raise the exception Broken pipe

at Method)





Thank you very much.

Best Regards

Muhui Jiang

2015-10-13 16:35 GMT+08:00 Simone Bordet <sbordet@xxxxxxxxxxx>:

On Tue, Oct 13, 2015 at 9:39 AM, Muhui Jiang <jiangmuhui@xxxxxxxxx> wrote:
> Hi,
> Simone, Thanks for your detailed suggestions.
> So in your code, you mean
> List<ByteBuffer> buffers = lease.getByteBuffers();
> the list is the whole Continuation frames?

It contains a list of buffers to write.
The buffers are typically 2 per frame: 1 buffer containing the header
bytes, 1 buffer containing the body bytes.

> But how can I write the continuation frame to the server periodically. I
> tried to use
> session.newStream(headers,
> new Promise.Adapter<>(), new Stream.Listener.Adapter() {}
> this way to send the headers but the result is that I can get the whole
> headersframe immediately.

Sure that will send a whole HEADERS frame.

You need to generate the buffers with the Generator and then write the
buffers one at a time.

> My question is how to write the buffer(Continuation frame) into the server
> periodically then the server can not get my whole headers frame in a short
> time. Many thanks.

List<ByteBuffer> buffers = lease.getByteBuffers();
for (ByteBuffer buffer : buffers)

Alternatively, you can just generate the buffers and then continuously
send the same couple of buffers over and over.

buffers[0] = HEADERS header bytes
buffers[1] = HEADERS body bytes
buffers[2] = CONTINUATION #1 headers bytes
buffers[3] = CONTINUATION #1 body bytes
buffers[4] = CONTINUATION #2 headers bytes
buffers[5] = CONTINUATION #2 body bytes

Simone Bordet
Developer advice, training, services and support
from the Jetty & CometD experts.
jetty-users mailing list
To change your delivery options, retrieve your password, or unsubscribe from this list, visit

Back to the top