Skip to content

[FEATURE] Set SocketOpts #2965

Closed

Description

@Bibo-Joshi

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.

Activity

  1. Delhibabu1 commented on Apr 26, 2023

    @Delhibabu1
  2. Bibo-Joshi commented on Apr 26, 2023

    @Bibo-Joshi
    Author
  3. Delhibabu1 commented on Apr 27, 2023

    @Delhibabu1
  4. Bibo-Joshi commented on Apr 27, 2023

    @Bibo-Joshi
    Author
  5. Delhibabu1 commented on Apr 28, 2023

    @Delhibabu1
  6. clot27 commented on Apr 28, 2023

    @clot27
  7. Delhibabu1 commented on Apr 29, 2023

    @Delhibabu1
  8. Bibo-Joshi commented on Sep 25, 2023

    @Bibo-Joshi
    MemberAuthor

    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

  9. locked and limited conversation to collaborators on Oct 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Fields

    Priority

    None yet

    Effort

    None yet

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions