Skip to content

Commit e981997

Browse files
committed
HttpServerUsingTasks is experimental
1 parent 77381df commit e981997

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

src/dlna/HttpServerUsingTasks.h

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66
namespace tiny_dlna {
77

88
/**
9-
* @brief HTTP server implementation that handles each client in a separate
10-
* task.
9+
* @brief Experimental HTTP server implementation that handles each client in a
10+
* separate task.
1111
*
1212
* This class extends HttpServer and, upon a new client connection, spawns a
1313
* dedicated Task to handle the client. The task runs until the client
@@ -30,7 +30,7 @@ class HttpServerUsingTasks : public HttpServer<ClientType, ServerType> {
3030

3131
public:
3232
HttpServerUsingTasks(ServerType& server, int bufferSize = 1024,
33-
int taskStackSize = 4096, int taskPriority = 1)
33+
int taskStackSize = 1024 * 8, int taskPriority = 1)
3434
: HttpServer<ClientType, ServerType>(server, bufferSize),
3535
taskStackSize_(taskStackSize),
3636
taskPriority_(taskPriority) {}
@@ -65,6 +65,7 @@ class HttpServerUsingTasks : public HttpServer<ClientType, ServerType> {
6565
Task* clientTask = tasks_.back().get();
6666
clientTask->begin([this, client, clientTask]() mutable {
6767
this->handleClientTask(client);
68+
delay(5);
6869
DlnaLogger.log(DlnaLogLevel::Debug, "Removing client");
6970
});
7071
}

src/dlna_config.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,17 +7,17 @@
77

88
/// Define scheduler run interval in ms
99
#ifndef DLNA_RUN_SCHEDULER_EVERY_MS
10-
#define DLNA_RUN_SCHEDULER_EVERY_MS 20
10+
#define DLNA_RUN_SCHEDULER_EVERY_MS 10
1111
#endif
1212

1313
/// Define subscription publish interval in ms
1414
#ifndef DLNA_RUN_SUBSCRIPTIONS_EVERY_MS
15-
#define DLNA_RUN_SUBSCRIPTIONS_EVERY_MS 20
15+
#define DLNA_RUN_SUBSCRIPTIONS_EVERY_MS 10
1616
#endif
1717

1818
/// Define the default http request timeout
1919
#ifndef DLNA_HTTP_REQUEST_TIMEOUT_MS
20-
#define DLNA_HTTP_REQUEST_TIMEOUT_MS 50
20+
#define DLNA_HTTP_REQUEST_TIMEOUT_MS 60
2121
#endif
2222

2323
/// Define XML parse buffer size

0 commit comments

Comments
 (0)