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

[FEATURE] Set SocketOpts #2965

Closed
Bibo-Joshi opened this issue Apr 24, 2022 · 8 comments · Fixed by #3935
Closed

[FEATURE] Set SocketOpts #2965

Bibo-Joshi opened this issue Apr 24, 2022 · 8 comments · Fixed by #3935

Comments

@Bibo-Joshi
Copy link
Member

To improve the networking backend, we would like to set socketopts if possible. Before the asyncio switch, we did something like

# TODO p0: On Linux, use setsockopt to properly set socket level keepalive.
# (socket.IPPROTO_TCP, socket.TCP_KEEPIDLE, 120)
# (socket.IPPROTO_TCP, socket.TCP_KEEPINTVL, 30)
# (socket.IPPROTO_TCP, socket.TCP_KEEPCNT, 8)
# TODO p4: Support setsockopt on lesser platforms than Linux.

It would be nice if we could do that for httpx as well at some point.

@Delhibabu1

This comment was marked as outdated.

@Bibo-Joshi

This comment was marked as resolved.

@Delhibabu1

This comment was marked as outdated.

@Bibo-Joshi

This comment was marked as resolved.

@Delhibabu1

This comment was marked as resolved.

@clot27

This comment was marked as resolved.

@Delhibabu1

This comment was marked as outdated.

@Bibo-Joshi
Copy link
Member Author

httpx v0.25.0 added support for socket_options in encode/httpx#2716. The underlying change is encode/httpcore#668 and some documentation can be found here and here.
This might give us a handle to add support for socket options as well. CC @tsnoam

@github-actions github-actions bot locked and limited conversation to collaborators Oct 30, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants