Title: socketserver: Add missing ForkingUnixStreamServer and ForkingUnixDatagramServer servers · Issue #103673 · python/cpython · GitHub
Open Graph Title: socketserver: Add missing ForkingUnixStreamServer and ForkingUnixDatagramServer servers · Issue #103673 · python/cpython
X Title: socketserver: Add missing ForkingUnixStreamServer and ForkingUnixDatagramServer servers · Issue #103673 · python/cpython
Description: Enhancement This issue / PR addresses two missing servers from the socketserver module Current behaviour socketserver has the following Protocol Family Simple Forking Threading TCP AF_INET TCPServer ForkingTCPServer ThreadingTCPServer TC...
Open Graph Description: Enhancement This issue / PR addresses two missing servers from the socketserver module Current behaviour socketserver has the following Protocol Family Simple Forking Threading TCP AF_INET TCPServe...
X Description: Enhancement This issue / PR addresses two missing servers from the socketserver module Current behaviour socketserver has the following Protocol Family Simple Forking Threading TCP AF_INET TCPServe...
Opengraph URL: https://github.com/python/cpython/issues/103673
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"socketserver: Add missing ForkingUnixStreamServer and ForkingUnixDatagramServer servers","articleBody":"# Enhancement\r\n\r\nThis issue / PR addresses two missing servers from the `socketserver` module\r\n\r\n## Current behaviour\r\n\r\nsocketserver has the following\r\n\r\n| Protocol | Family | Simple | Forking | Threading |\r\n| - | - | - | - | - |\r\n| TCP | AF_INET | TCPServer | ForkingTCPServer | ThreadingTCPServer |\r\n| TCP | AF_UNIX | UnixStreamServer | ??? | ThreadingUnixStreamServer |\r\n| UDP | AF_INET | UDPServer | ForkingUDPServer | ThreadingUDPServer |\r\n| UDP | AF_UNIX | UnixDatagramServer | ??? | ThreadingUnixDatagramServer |\r\n\r\nObserve the two gaps marked by \"???\"\r\n\r\n## Proposal\r\n\r\nIn the case `hasattr(socket, \"AF_UNIX\") and hasattr(os, \"fork\")` we enable the two missing servers as\r\n\r\n```py\r\nclass ForkingUnixStreamServer(ForkingMixIn, UnixStreamServer): pass\r\n\r\nclass ForkingUnixDatagramServer(ForkingMixIn, UnixDatagramServer): pass\r\n```\r\n\r\nThese follow the established naming convention\r\n\r\nThis enhancement is completely forwards/backwards compatible\r\n\r\nMentions in the documentation are included in the PR corresponding to this issue\r\n\r\n# Pitch\r\n\r\nGoogling `ForkingUnixStreamServer` shows a few people / codebases which define such a class in the same manner as above. I myself have done so in a [project](https://github.com/jb2170/SocketCat/blob/73d3bf4f30bfb1ad6e3b2710cc3a7586b5d1499c/src/SocketCat/common.py#L14).\r\n\r\nThese classes seem to have been overlooked because they require two `if` checks for `hasattr(socket, \"AF_UNIX\")` and `hasattr(os, \"fork\")`.\r\n\r\nIt seems clear to me therefore that these two classes should be added to the `socketserver` standard library module\r\n\r\nSome people prefer forks to threads\n\n\u003c!-- gh-linked-prs --\u003e\n### Linked PRs\n* gh-103674\n\u003c!-- /gh-linked-prs --\u003e\n","author":{"url":"https://github.com/jb2170","@type":"Person","name":"jb2170"},"datePublished":"2023-04-22T01:40:42.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":2},"url":"https://github.com/103673/cpython/issues/103673"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:d4f814ad-1e78-e973-fe23-93ffe838e977 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 90C0:15DFF5:237D272:307970B:696ACF67 |
| html-safe-nonce | d04f5b7d393b2e6ff6a994d2ff240309569ef5ded93ec821973abaf4c4151a9a |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5MEMwOjE1REZGNToyMzdEMjcyOjMwNzk3MEI6Njk2QUNGNjciLCJ2aXNpdG9yX2lkIjoiNjAzMTMyMTI1Mjk2NzkyNzY1NSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | ce4e7cf1a34a4239e7a5f9072a0f000732380b8451c05acccf965b5772d1740a |
| hovercard-subject-tag | issue:1679262810 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/python/cpython/103673/issue_layout |
| twitter:image | https://opengraph.githubassets.com/a82221533caeedbd1c7819782241437e8020d8d87797ef4b128dc27b650d760f/python/cpython/issues/103673 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/a82221533caeedbd1c7819782241437e8020d8d87797ef4b128dc27b650d760f/python/cpython/issues/103673 |
| og:image:alt | Enhancement This issue / PR addresses two missing servers from the socketserver module Current behaviour socketserver has the following Protocol Family Simple Forking Threading TCP AF_INET TCPServe... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | jb2170 |
| hostname | github.com |
| expected-hostname | github.com |
| None | c785f4ce187e9e7331257791b36ddee01625bb8e292a9b4fe2c16d4c006abf5d |
| turbo-cache-control | no-preview |
| go-import | github.com/python/cpython git https://github.com/python/cpython.git |
| octolytics-dimension-user_id | 1525981 |
| octolytics-dimension-user_login | python |
| octolytics-dimension-repository_id | 81598961 |
| octolytics-dimension-repository_nwo | python/cpython |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 81598961 |
| octolytics-dimension-repository_network_root_nwo | python/cpython |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | c718a376fcf780eb22089171adb84a543f660bf7 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width