[solved] nghttp2 -- closing a GET stream

User avatar
hassan789
Posts: 156
Joined: Thu Jun 29, 2017 2:15 am

[solved] nghttp2 -- closing a GET stream

Postby hassan789 » Sun Dec 10, 2017 2:17 am

Trying learn http2 using this example:

Code: Select all

https://github.com/espressif/esp-idf/tree/master/examples/protocols/http2_request
A GET stream is opened to a clock API, where the server pushes the time back to the ESP32 every 1 second. How can I close this stream after 5 seconds, without closing the session or the socket?

Any nghttp2 gurus that can help, would be nice.

Thanks :D
Last edited by hassan789 on Sun Dec 10, 2017 4:15 am, edited 1 time in total.

User avatar
hassan789
Posts: 156
Joined: Thu Jun 29, 2017 2:15 am

Re: nghttp2 -- closing a GET stream

Postby hassan789 » Sun Dec 10, 2017 4:14 am

Figured it out. Just have to call:

Code: Select all

nghttp2_submit_rst_stream(session, NGHTTP2_FLAG_NONE, frame->hd.stream_id, NGHTTP2_REFUSED_STREAM))
on the nghttp2_on_frame_recv_callback, aka callback_on_frame_recv() in this example.

Who is online

Users browsing this forum: Google [Bot] and 152 guests