<br><br><div class="gmail_quote">On Thu, Apr 7, 2011 at 1:23 PM, Glyph Lefkowitz <span dir="ltr">&lt;<a href="mailto:glyph@twistedmatrix.com">glyph@twistedmatrix.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div class="im"><br>
On Apr 7, 2011, at 12:16 PM, anatoly techtonik wrote:<br>
<br>
&gt; I&#39;ve made a proof of concept for asynchronous console input on Windows<br>
&gt; [1] and now I am trying to understand the limits of<br>
&gt; WaitForMultipleObjects API I&#39;ve used.<br>
&gt;<br>
&gt; Documentation on win32eventreactor mentions limit for 64 objects:<br>
&gt; <a href="http://twistedmatrix.com/documents/11.0.0/api/twisted.internet.win32eventreactor.htm" target="_blank">http://twistedmatrix.com/documents/11.0.0/api/twisted.internet.win32eventreactor.htm</a><br>
&gt; However, it is completely opaque what these objects are? For console<br>
&gt; handles and process handles it is quite obvious, but not for sockets.<br>
&gt;<br>
&gt; Is 64 the limit for total amount sockets opened on different ports?<br>
&gt; Is 64 the limit for connections made to a socket on specified port?<br>
&gt;<br>
&gt; 1. <a href="http://techtonik.rainforce.org/2011/03/asynchronous-input-from-windows-console.html" target="_blank">http://techtonik.rainforce.org/2011/03/asynchronous-input-from-windows-console.html</a><br>
<br>
</div>64 is the limit for the total number of objects (listening ports, connections to a port, client connections, your console, the waker, serial ports, whatever) that WFMO may wait upon at once.<br>
<br>
Put another way, MAXIMUM_WAIT_OBJECTS=64: <a href="http://msdn.microsoft.com/en-us/library/ms687025%28v=vs.85%29.aspx" target="_blank">http://msdn.microsoft.com/en-us/library/ms687025(v=vs.85).aspx</a><br>
<div><div></div><div class="h5"><br></div></div></blockquote></div><br>Note that you can wait on more than 64 objects at a time, just not using a single WaitForMultipleObjects call.  The MSDN page Glyph pointed out has a little more info.<br>
<br>Kevin Horn<br>