File tree Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Original file line number Diff line number Diff line change 4545#endif
4646
4747#ifndef CPPHTTPLIB_IDLE_INTERVAL_USECOND
48+ #ifdef _WIN32
49+ #define CPPHTTPLIB_IDLE_INTERVAL_USECOND 10000
50+ #else
4851#define CPPHTTPLIB_IDLE_INTERVAL_USECOND 0
4952#endif
53+ #endif
5054
5155#ifndef CPPHTTPLIB_REQUEST_URI_MAX_LENGTH
5256#define CPPHTTPLIB_REQUEST_URI_MAX_LENGTH 8192
@@ -3974,15 +3978,18 @@ inline bool Server::listen_internal() {
39743978 std::unique_ptr<TaskQueue> task_queue (new_task_queue ());
39753979
39763980 while (svr_sock_ != INVALID_SOCKET) {
3981+ #ifndef _WIN32
39773982 if (idle_interval_sec_ > 0 || idle_interval_usec_ > 0 ) {
3983+ #endif
39783984 auto val = detail::select_read (svr_sock_, idle_interval_sec_,
39793985 idle_interval_usec_);
39803986 if (val == 0 ) { // Timeout
39813987 task_queue->on_idle ();
39823988 continue ;
39833989 }
3990+ #ifndef _WIN32
39843991 }
3985-
3992+ # endif
39863993 socket_t sock = accept (svr_sock_, nullptr , nullptr );
39873994
39883995 if (sock == INVALID_SOCKET) {
You can’t perform that action at this time.
0 commit comments