h2 icon indicating copy to clipboard operation
h2 copied to clipboard

How to reuse the connection to send multiple requests in plain socket example

Open kootenpv opened this issue 3 years ago • 1 comments

I am loving the example here https://github.com/python-hyper/h2/blob/master/examples/plain_sockets/plain_sockets_client.py

I just can't seem to figure out how to be making multiple requests reusing the same connection?

For example, if I wanted to send the same request again, how could I do that after print("Response fully received:")

I understand I might need to use a next stream ID, but it is not clear how to do it. Any help would be much appreciated!

kootenpv avatar Mar 12 '22 11:03 kootenpv

where the example uses 1 as stream id, use c.get_next_available_stream_id()

RonnyPfannschmidt avatar Feb 19 '24 09:02 RonnyPfannschmidt