mirror of
https://github.com/cesanta/mongoose.git
synced 2026-11-08 16:11:18 +00:00
Use user timeout in multithreading polling
PUBLISHED_FROM=dbf75bfba087f1b0aa0531e5003ba3e69ed1a6ab
This commit is contained in:
1 parent
d9b7ec18e7
commit
4cbf81da59
4 files changed
+49
-3
No files matched your search
+11
@@ -189,6 +189,7 @@
|
||||
#endif
|
||||
#if defined(_MSC_VER) && _MSC_VER <= 1200
|
||||
typedef unsigned long uintptr_t;
|
||||
typedef long intptr_t;
|
||||
#endif
|
||||
typedef int socklen_t;
|
||||
#if _MSC_VER >= 1700
|
||||
@@ -287,6 +288,7 @@ typedef struct _stati64 cs_stat_t;
|
||||
#include <errno.h>
|
||||
#include <fcntl.h>
|
||||
#include <inttypes.h>
|
||||
#include <stdint.h>
|
||||
#include <limits.h>
|
||||
#include <math.h>
|
||||
#include <netdb.h>
|
||||
@@ -1583,6 +1585,13 @@ int mg_resolve(const char *domain_name, char *ip_addr_buf, size_t buf_len);
|
||||
*/
|
||||
int mg_check_ip_acl(const char *acl, uint32_t remote_ip);
|
||||
|
||||
/*
|
||||
* Optional parameters for mg_enable_multithreading_opt()
|
||||
*/
|
||||
struct mg_multithreading_opts {
|
||||
int poll_timeout; /* Polling interval */
|
||||
};
|
||||
|
||||
/*
|
||||
* Enables multi-threaded handling for the given listening connection `nc`.
|
||||
* For each accepted connection, Mongoose will create a separate thread
|
||||
@@ -1591,6 +1600,8 @@ int mg_check_ip_acl(const char *acl, uint32_t remote_ip);
|
||||
* other connections.
|
||||
*/
|
||||
void mg_enable_multithreading(struct mg_connection *nc);
|
||||
void mg_enable_multithreading_opt(struct mg_connection *nc,
|
||||
struct mg_multithreading_opts opts);
|
||||
|
||||
#ifdef MG_ENABLE_JAVASCRIPT
|
||||
/*
|
||||
|
||||
Reference in new issue
Block a user