return -1;
}
- pfd->revents = (networkevents.lNetworkEvents & LWS_POLLIN) ? LWS_POLLIN : 0;
+ pfd->revents = networkevents.lNetworkEvents;
- if (networkevents.lNetworkEvents & LWS_POLLOUT) {
+ if (pfd->revents & LWS_POLLOUT)
context->lws_lookup[pfd->fd]->sock_send_blocking = FALSE;
- pfd->revents |= LWS_POLLOUT;
- }
return libwebsocket_service_fd(context, pfd);
#else
struct libwebsocket_pollfd *pfd;
struct libwebsocket_pollargs pa;
#ifdef _WIN32
- long networkevents = FD_WRITE;
+ long networkevents = LWS_POLLOUT | LWS_POLLHUP;
#endif
pfd = &context->fds[wsi->position_in_fds_table];