GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — socketserver: Add missing ForkingUnixStreamServer and ForkingUnixDatagramServer servers · Issue #103673 · python/cpython

socketserver: Add missing ForkingUnixStreamServer and ForkingUnixDatagramServer servers #103673

New issue
Copy link
New issue
Copy link
Closed
Closed
socketserver: Add missing ForkingUnixStreamServer and ForkingUnixDatagramServer servers#103673
Copy link
Assignees
gpshead
Labels
type-featureA feature request or enhancementA feature request or enhancement

Description

@jb2170
jb2170
opened on Apr 22, 2023
Issue body actions

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
TCP AF_UNIX UnixStreamServer ??? ThreadingUnixStreamServer
UDP AF_INET UDPServer ForkingUDPServer ThreadingUDPServer
UDP AF_UNIX UnixDatagramServer ??? ThreadingUnixDatagramServer

Observe the two gaps marked by "???"

Proposal

In the case hasattr(socket, "AF_UNIX") and hasattr(os, "fork") we enable the two missing servers as

class ForkingUnixStreamServer(ForkingMixIn, UnixStreamServer): pass

class ForkingUnixDatagramServer(ForkingMixIn, UnixDatagramServer): pass

These follow the established naming convention

This enhancement is completely forwards/backwards compatible

Mentions in the documentation are included in the PR corresponding to this issue

Pitch

Googling 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.

These classes seem to have been overlooked because they require two if checks for hasattr(socket, "AF_UNIX") and hasattr(os, "fork").

It seems clear to me therefore that these two classes should be added to the socketserver standard library module

Some people prefer forks to threads

Linked PRs

  • gh-103673: Add missing ForkingUnixStreamServer and ForkingUnixDatagramServer socketservers #103674

Activity

  1. jb2170
    added
    type-featureA feature request or enhancementA feature request or enhancement
    on Apr 22, 2023
  2. gpshead
    self-assigned this
    on Apr 23, 2023
  3. jb2170
    added a commit that references this issue on Apr 24, 2023

    Merge branch 'main' into pythongh-103673

    afb4520
  4. gpshead
    added 2 commits that reference this issue on Apr 24, 2023

    Merge branch 'main' into pythongh-103673

    7d0ac34

    gh-103673: Add missing ForkingUnixStreamServer and ForkingUnixDatagra…

    d94b3a6
  5. jb2170 commented on Apr 24, 2023

    @jb2170
    jb2170
    on Apr 24, 2023
    ContributorAuthor
    More actions

    Completed by d94b3a6, nice one!

  6. jb2170
    closed this as completedon Apr 24, 2023
  7. gpshead commented on Apr 24, 2023

    @gpshead
    gpshead
    on Apr 24, 2023
    Member
    More actions

    Thanks!

  8. carljm
    added a commit that references this issue on Apr 24, 2023

    Merge branch 'main' into superopt_spec

    3236f45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

  • @gpshead
    gpshead

Labels

type-featureA feature request or enhancementA feature request or enhancement

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

    You are visitor 01402503 — GeezerVison does not store the pages you look up.
    Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.