socket-win: Use non-overlapped I/O and socket event selection
authorMartin Willi <martin@revosec.ch>
Tue, 10 Jun 2014 13:58:31 +0000 (15:58 +0200)
committerMartin Willi <martin@revosec.ch>
Tue, 17 Jun 2014 13:19:25 +0000 (15:19 +0200)
commit2d846c2035de26a52d1439b46b0ca7903fa9dca1
treeb18c76573e32c79dc697af4297877f58d1c5b16f
parent31f26960761c7f45505957327f303e57551c9997
socket-win: Use non-overlapped I/O and socket event selection

The use of overlapped I/O was incorrect, as we passed stack based buffers, but
did not cancel/wait for pending completion on all sockets. Our receive-from-all
socket interface is actually tricky to implement using overlapped I/O. Switch
to WSAEventSelect() event management, which can be canceled properly while
working in a select()-like way.
src/libcharon/plugins/socket_win/socket_win_socket.c