mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-07-02 17:28:30 +00:00
Add poll() embedded webserver demo to redbean
This commit is contained in:
parent
0dca4c5799
commit
38728cef79
5 changed files with 140 additions and 2 deletions
|
@ -160,7 +160,9 @@ textwindows int sys_poll_nt(struct pollfd *fds, uint64_t nfds, uint64_t *ms) {
|
|||
// we need to poll the socket handles separately because
|
||||
// microsoft certainly loves to challenge us with coding
|
||||
// please note that winsock will fail if we pass zero fd
|
||||
#if _NTTRACE
|
||||
POLLTRACE("WSAPoll(%p, %u, %'d) out of %'lu", sockfds, sn, waitfor, *ms);
|
||||
#endif
|
||||
if ((gotsocks = WSAPoll(sockfds, sn, waitfor)) == -1) {
|
||||
return __winsockerr();
|
||||
}
|
||||
|
|
|
@ -39,7 +39,9 @@ textwindows int __wsablock(int64_t handle, struct NtOverlapped *overlapped,
|
|||
return __winsockerr();
|
||||
} else if (i == kNtWaitTimeout || i == kNtWaitIoCompletion) {
|
||||
if (_check_interrupts(restartable, g_fds.p)) return eintr();
|
||||
#if _NTTRACE
|
||||
POLLTRACE("WSAWaitForMultipleEvents...");
|
||||
#endif
|
||||
} else {
|
||||
break;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue