win: unify uv_{tcp,udp}_set_socket.

Fixes #205.
This commit is contained in:
Erick Tryzelaar 2011-10-01 22:30:12 -07:00 committed by Ryan Dahl
parent 4c329060ca
commit 0303197a57

View File

@ -89,13 +89,14 @@ static int uv_udp_set_socket(uv_loop_t* loop, uv_udp_t* handle,
}
if (pSetFileCompletionNotificationModes) {
if (!pSetFileCompletionNotificationModes((HANDLE)socket,
FILE_SKIP_SET_EVENT_ON_HANDLE | FILE_SKIP_COMPLETION_PORT_ON_SUCCESS)) {
if (pSetFileCompletionNotificationModes((HANDLE)socket,
FILE_SKIP_SET_EVENT_ON_HANDLE |
FILE_SKIP_COMPLETION_PORT_ON_SUCCESS)) {
handle->flags |= UV_HANDLE_SYNC_BYPASS_IOCP;
} else if (GetLastError() != ERROR_INVALID_FUNCTION) {
uv__set_sys_error(loop, GetLastError());
return -1;
}
handle->flags |= UV_HANDLE_SYNC_BYPASS_IOCP;
}
handle->socket = socket;