Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
kootenpv opened this issue Mar 12, 2022 · 1 comment

Comments

@kootenpv
Copy link

kootenpv commented Mar 12, 2022

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!

@RonnyPfannschmidt
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants