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

Multicast example mcast.py is outdated and ugly #49629

Closed
phihag mannequin opened this issue Feb 27, 2009 · 4 comments
Closed

Multicast example mcast.py is outdated and ugly #49629

phihag mannequin opened this issue Feb 27, 2009 · 4 comments
Assignees
Labels
type-bug An unexpected behavior, bug, or error

Comments

@phihag
Copy link
Mannequin

phihag mannequin commented Feb 27, 2009

BPO 5379
Nosy @gpshead
Files
  • mcast-example.diff: Updated patch to fix all problems mentioned here
  • Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

    Show more details

    GitHub fields:

    assignee = 'https://github.com/gpshead'
    closed_at = <Date 2009-05-03.19:10:14.451>
    created_at = <Date 2009-02-27.01:50:00.535>
    labels = ['type-bug']
    title = 'Multicast example mcast.py is outdated and ugly'
    updated_at = <Date 2009-05-03.19:10:14.422>
    user = 'https://bugs.python.org/phihag'

    bugs.python.org fields:

    activity = <Date 2009-05-03.19:10:14.422>
    actor = 'gregory.p.smith'
    assignee = 'gregory.p.smith'
    closed = True
    closed_date = <Date 2009-05-03.19:10:14.451>
    closer = 'gregory.p.smith'
    components = ['Demos and Tools']
    creation = <Date 2009-02-27.01:50:00.535>
    creator = 'phihag'
    dependencies = []
    files = ['13851']
    hgrepos = []
    issue_num = 5379
    keywords = ['patch']
    message_count = 4.0
    messages = ['82810', '82811', '87047', '87059']
    nosy_count = 2.0
    nosy_names = ['gregory.p.smith', 'phihag']
    pr_nums = []
    priority = 'normal'
    resolution = 'accepted'
    stage = None
    status = 'closed'
    superseder = None
    type = 'behavior'
    url = 'https://bugs.python.org/issue5379'
    versions = ['Python 2.6', 'Python 3.0', 'Python 3.1', 'Python 2.7']

    @phihag
    Copy link
    Mannequin Author

    phihag mannequin commented Feb 27, 2009

    The multicast example Demo/sockets/mcast.py

    1. mentions that multicast is only implemented on SGI (and optional on
      other systems). That is not the case anymore.
    2. Includes completely unrelated code for broadcast transmission. There
      is already an example for that, suitably named broadcast.py (in the same
      directory).
    3. Does only support IPv4.
    4. Is borderline buggy. Line 85 only works by accident. Similarly, line
      37 fails if the TTL would be increased to >127.
    5. Is ugly. Line 79-81 are an example of how not to write python code,
      line 62 can be deleted without changing the program's semantics.
      (All line numbers refer to rev70006)

    The attached patch removes broadcast support in mcast.py, adds IPv6
    support and fixes all other problems mentioned above.

    @phihag phihag mannequin added the type-bug An unexpected behavior, bug, or error label Feb 27, 2009
    @gpshead
    Copy link
    Member

    gpshead commented Feb 27, 2009

    heh yuck that code was ancient. thanks for the update, i'll submit it.

    @gpshead gpshead self-assigned this Feb 27, 2009
    @phihag
    Copy link
    Mannequin Author

    phihag mannequin commented May 3, 2009

    Updated patch to use the new ipaddr module instead of the
    platform-specific socket.inet_pton (unavailable on some platforms,
    including Windows XP)
    Updated formatting

    @gpshead
    Copy link
    Member

    gpshead commented May 3, 2009

    thanks! committed in r72237 & py3k r72238.

    @gpshead gpshead closed this as completed May 3, 2009
    @ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    type-bug An unexpected behavior, bug, or error
    Projects
    None yet
    Development

    No branches or pull requests

    1 participant