<div class="gmail_quote"><div>[Me] <br></div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><div class="gmail_quote"><div class="Ih2E3d"><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div><div>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.</div>
</div></blockquote></div><div></div></div></blockquote><div><br>[Tal]<br></div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><div class="gmail_quote">
<div>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?<br></div></div></blockquote></div><br>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.<br>
<br>As for binding to commonly used ports, nearly all <i>client</i> 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.<br>
<br>Dave<br>