Skip to content

Commit d61e334

Browse files
committed
Fix benchmark test problem on Windows
1 parent 318a3fe commit d61e334

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

httplib.h

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3283,7 +3283,10 @@ inline ssize_t select_write(socket_t sock, time_t sec, time_t usec) {
32833283

32843284
inline Error wait_until_socket_is_ready(socket_t sock, time_t sec,
32853285
time_t usec) {
3286-
#ifdef __APPLE__
3286+
#if defined(__APPLE__) || defined(_WIN32)
3287+
// Use select() on macOS and Windows for better performance with localhost
3288+
// connections. WSAPoll() on Windows has known performance issues with
3289+
// localhost.
32873290
if (sock >= FD_SETSIZE) { return Error::Connection; }
32883291

32893292
fd_set fdsr, fdsw;

0 commit comments

Comments
 (0)