webby
webby copied to clipboard
select() timeout with 5 usecs causes hitches on Windows
webby.c around line 1333:
timeout.tv_sec = 0;
timeout.tv_usec = 5;
err = select((int) (max_socket + 1), &read_fds, &write_fds, &except_fds, &timeout);
I experienced large hitches in the select()
call on Windows (VS 2015 Update 1, x64, Windows 10) until I set the tv_usec
field to 0 instead of 5. I assume there's a timer granularity difference between the current Winsock libraries and whatever platform Webby has been tested with.
Maybe this should be a server config option.
I think that makes sense. I can't personally think of a reason I'd want a timeout at all (even if it didn't cause Windows hitches), but I'm sure you and others have valid use cases.