Skip to content
Snippets Groups Projects
Commit da77a600 authored by Galen Ma's avatar Galen Ma Committed by Andy Green
Browse files
parent c5376b14
No related branches found
No related tags found
No related merge requests found
...@@ -353,6 +353,10 @@ lws_create_context(struct lws_context_creation_info *info) ...@@ -353,6 +353,10 @@ lws_create_context(struct lws_context_creation_info *info)
int pid_daemon = get_daemonize_pid(); int pid_daemon = get_daemonize_pid();
#endif #endif
int n, m; int n, m;
#if defined(__ANDROID__)
struct rlimit rt;
#endif
lwsl_notice("Initial logging level %d\n", log_level); lwsl_notice("Initial logging level %d\n", log_level);
lwsl_notice("Libwebsockets version: %s\n", library_version); lwsl_notice("Libwebsockets version: %s\n", library_version);
...@@ -390,7 +394,16 @@ lws_create_context(struct lws_context_creation_info *info) ...@@ -390,7 +394,16 @@ lws_create_context(struct lws_context_creation_info *info)
lwsl_notice(" Started with daemon pid %d\n", pid_daemon); lwsl_notice(" Started with daemon pid %d\n", pid_daemon);
} }
#endif #endif
context->max_fds = getdtablesize(); #if defined(__ANDROID__)
n = getrlimit ( RLIMIT_NOFILE,&rt);
if (-1 == n) {
lwsl_err("Get RLIMIT_NOFILE failed!\n");
return NULL;
}
context->max_fds = rt.rlim_cur;
#else
context->max_fds = getdtablesize();
#endif
if (info->count_threads) if (info->count_threads)
context->count_threads = info->count_threads; context->count_threads = info->count_threads;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment