1

I want to create a thread that waits for activity on a TCP socket as well as some other application specific events. To achieve this I was thinking if I can use the event handle that I associated with a socket using WSAEventSelect() along with other general purpose (my app specific events) in a WaitForMultipleObjects() function?

I am writing my application on Windows Embedded Compact 7

deepak
  • 13
  • 5
  • Based on the documentation, it looks like it would be more correct to use WSAWaitForMultipleEvents. That explicitly supports "handles of objects of different types" whereas there's nothing obvious that promises that a WSA event handle will work in general wait functions. (I'm pretty sure it will work either way in practice.) – Harry Johnston Jan 25 '17 at 22:30
  • 1
    In practice, `WSACreateEvent()` is just a wrapper for `CreateEvent()`, and `WSAWaitForMultipleEvents()` is a wrapper for `WaitForMultipleObjects()`, so they *can* be used interchangeably, however you *shouldn't* since they are technically two separate APIs and the WSA implementation could always change in the future without breaking compliant code. – Remy Lebeau Jan 26 '17 at 00:07

0 Answers0