Message50763
| Author |
taleinat |
| Recipients |
| Date |
2006年07月26日.17:45:06 |
| SpamBayes Score |
| Marked as misclassified |
| Message-id |
| In-reply-to |
| Content |
(See patch 1201569 "allow running multiple instances of
IDLE" for previous discussion on this topic)
To summarize discussion up to this point: There is a
problem doing this on Windows since more than one
listening socket can be openned on a single port.
I suggest we "dodge" the Windows problem for now by
having IDLE try a random port every time (like in the
IDLEfork patch 661363) - thus collisions will be kept
to a minimum. If we choose among over 10,000 ports,
most users will never encounter a port collision. And
even when a collision does happen, it will probably be
detected and properly dealt with - collision
non-detection errors are, as Kurt mentioned, erratic.
This patch chooses a port from range(49152, 65536),
which are the 'dynamic' ports as described by the DCCP
(see http://www.iana.org/assignments/port-numbers), and
avoids known 'dangerous' ports (used by trojans, worms,
etc.) which I gathered by Googling for half an hour.
I replaced socket.timeout with select(), since I find
its timeout mechanism is more reliable. (Currently,
Python's socket's timeout mechanism raises unexpected,
unexplained errors on Windows.)
I also changed the flow a bit, so if a timeout occurs
after a sub-process is spawned, the subprocess is killed.
IMO This requires thorough testing. I tested it for
half an hour on my WinXP Python2.4.3, and after fixing
typos and such, everything seems to work. |
|
History
|
|---|
| Date |
User |
Action |
Args |
| 2007年08月23日 15:53:45 | admin | link | issue1529142 messages |
| 2007年08月23日 15:53:45 | admin | create |
|