[Idle-dev] Fix for long delays

David Scherer dscherertemp at gmail.com
Sat Jun 7 01:25:36 CEST 2008


[Me]

> Why not just bind to port 0 ("any") and then do self.port =
>> self.rpcclt.listening_sock.getsockname()[1] to find what port the OS has
>> assigned?  I tried that and IWFM.
>>
>
[Tal]

> I've never heard of that option - it sounds great! Is it supported on all
> platforms? Can't that cause problems by binding to ports commonly used by
> other programs?
>

I can't guarantee that it works on all platforms, but my belief is that it's
standard BSD sockets behavior.  It almost certainly works on Windows and
Linux.

As for binding to commonly used ports, nearly all *client* programs are also
asking the OS to allocate ports for them, so I don't IDLE asking for two
ports instead of one is a big problem :-).  I expect each OS does something
very similar to what you did internally, allocating ports from a range that
doesn't have a lot of well-known ports.

Dave
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/idle-dev/attachments/20080606/2623545f/attachment.htm>


More information about the IDLE-dev mailing list