classification
Title: Multicast example mcast.py is outdated and ugly
Type: behavior Stage:
Components: Demos and Tools Versions: Python 3.0, Python 3.1, Python 2.7, Python 2.6
process
Status: closed Resolution: accepted
Dependencies: Superseder:
Assigned To: gregory.p.smith Nosy List: gregory.p.smith, phihag
Priority: normal Keywords: patch

Created on 2009-02-27 01:50 by phihag, last changed 2009-05-03 19:10 by gregory.p.smith. This issue is now closed.

Files
File name Uploaded Description Edit
mcast-example.diff phihag, 2009-05-03 15:15 Updated patch to fix all problems mentioned here
Messages (4)
msg82810 - (view) Author: Philipp Hagemeister (phihag) * Date: 2009-02-27 01:49
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.
msg82811 - (view) Author: Gregory P. Smith (gregory.p.smith) * (Python committer) Date: 2009-02-27 01:52
heh yuck that code was ancient.  thanks for the update, i'll submit it.
msg87047 - (view) Author: Philipp Hagemeister (phihag) * Date: 2009-05-03 15:15
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
msg87059 - (view) Author: Gregory P. Smith (gregory.p.smith) * (Python committer) Date: 2009-05-03 19:10
thanks!  committed in r72237 & py3k r72238.
History
Date User Action Args
2009-05-03 19:10:14gregory.p.smithsetstatus: open -> closed
resolution: accepted
messages: + msg87059
2009-05-03 15:15:51phihagsetfiles: - mcast-example.diff
2009-05-03 15:15:42phihagsetfiles: + mcast-example.diff

messages: + msg87047
2009-02-27 01:52:51gregory.p.smithsetpriority: normal
2009-02-27 01:52:20gregory.p.smithsetassignee: gregory.p.smith
messages: + msg82811
nosy: + gregory.p.smith
2009-02-27 01:50:00phihagcreate