Fix event created for WSAEventSelect: The event we pass to WSAEventSelect should...
authorzihao.jiang <zihao.jiang@yahoo.com>
Tue, 30 Jun 2015 17:13:28 +0000 (01:13 +0800)
committerzihao.jiang <zihao.jiang@yahoo.com>
Tue, 30 Jun 2015 17:52:59 +0000 (01:52 +0800)
From MSDN, it looks same as CreateEvent(NULL, FALSE, FALSE, NULL):
The WSACreateEvent function creates a manual-reset event object with an initial state of nonsignaled. The event object is unnamed.
However they are not really equivalent. When we use normal event, the WSAEventSelect still works but the event appears to be 'auto-reset'.

libfreerdp/core/tcp.c

index 4eb7b0c..e4c84bd 100644 (file)
@@ -360,7 +360,7 @@ static int transport_bio_simple_init(BIO* bio, SOCKET socket, int shutdown)
        bio->init = 1;
 
 #ifdef _WIN32
-               ptr->hEvent = CreateEvent(NULL, FALSE, FALSE, NULL);
+               ptr->hEvent = WSACreateEvent();
 
                if (!ptr->hEvent)
                        return 0;