webby icon indicating copy to clipboard operation
webby copied to clipboard

select() timeout with 5 usecs causes hitches on Windows

Open seanmiddleditch opened this issue 9 years ago • 2 comments

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.

seanmiddleditch avatar Jan 30 '16 22:01 seanmiddleditch

Maybe this should be a server config option.

deplinenoise avatar Jan 31 '16 19:01 deplinenoise

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.

seanmiddleditch avatar Jan 31 '16 22:01 seanmiddleditch