I cant seem to find WSACreateEvent anywhere, is it exposed?<div><br></div><div>There is win32event.CreateEvent but it takes 4 arguments.<br><div><br></div><div>I can find win32file.WSAEventSelect alright.</div><div><br><br>
<div class="gmail_quote">On 26 May 2011 10:05, Amaury Forgeot d'Arc <span dir="ltr"><<a href="mailto:amauryfa@gmail.com">amauryfa@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
2011/5/26 David Markey <<a href="mailto:admin@dmarkey.com">admin@dmarkey.com</a>>:<br>
<div class="im">> Hi All,<br>
> Sorry for the n00b question...<br>
> With win32event.WaitForMultipleObjects, I dont seem to be able to give it a<br>
> plain socket object. How can I create a PyHANDLE from a socket?<br>
<br>
</div>It won't work like this, because a socket has several things you<br>
can wait for (available for read, available for write, accept, error,<br>
and probably others)<br>
<br>
You should use WSAEventSelect() to associate a socket with a handle.<br>
<br>
This is pseudo-code (I don't have Windows at the moment, sorry)::<br>
<br>
socket_event = WSACreateEvent()<br>
WSAEventSelect(mysocket, socket_event, FD_READ | FD_CLOSE)<br>
... then socket_event may be used in WaitForMultipleObjects...<br>
WSACloseEvent(socket_event)<br>
<br>
<br>
--<br>
<font color="#888888">Amaury Forgeot d'Arc<br>
</font></blockquote></div><br></div></div>