RTWinPoll.cpp revision a218a3f92594b5f2beb9c8298c6fe6e3a8e502f8
/* -*- indent-tabs-mode: nil; -*- */
#include <Winsock2.h>
#include <Windows.h>
#include "winpoll.h"
static HANDLE g_hNetworkEvent;
int
{
if (g_hNetworkEvent == WSA_INVALID_EVENT)
{
}
for (unsigned int i = 0; i < nfds; ++i)
{
long eventMask = 0;
/* clean revents */
/* ignore invalid sockets */
continue;
/**
* POLLIN Data other than high priority data may be read without blocking.
* This is equivalent to ( POLLRDNORM | POLLRDBAND ).
* POLLRDBAND Priority data may be read without blocking.
* POLLRDNORM Normal data may be read without blocking.
*/
if (pollEvents & POLLIN)
/**
* POLLOUT Normal data may be written without blocking. This is equivalent
* to POLLWRNORM.
* POLLWRNORM Normal data may be written without blocking.
*/
if (pollEvents & POLLOUT)
/**
* This is "moral" equivalent to POLLHUP.
*/
}
FALSE);
if (index != WSA_WAIT_EVENT_0)
{
if (index == WSA_WAIT_TIMEOUT)
return VERR_TIMEOUT;
}
int nready = 0;
for (unsigned int i = 0; i < nfds; ++i)
{
short revents = 0;
int err;
continue;
if (err == SOCKET_ERROR)
{
if (WSAGetLastError() == WSAENOTSOCK)
{
++nready;
}
continue;
}
/* deassociate socket with event */
{
}
{
}
{
}
/* paranoid */
if (revents != 0)
{
++nready;
}
}
if (pNready)
return VINF_SUCCESS;
}