1
0
Fork 0
mirror of https://github.com/warmcat/libwebsockets.git synced 2025-03-30 00:00:16 +01:00

Fixes the binding error when SMP in tandem with a Unix domain socket

This commit is contained in:
張俊芝 2018-07-08 15:33:10 +08:00 committed by Andy Green
parent 6517e01258
commit 8f5738299a

View file

@ -131,6 +131,17 @@ done_list:
(void)n; (void)n;
#if defined(__linux__) #if defined(__linux__)
#ifdef LWS_WITH_UNIX_SOCK
/*
* A Unix domain sockets cannot be bound for several times, even if we set
* the SO_REUSE* options on.
* However, fortunately, each thread is able to independently listen when
* running on a reasonably new Linux kernel. So we can safely assume
* creating just one listening socket for a multi-threaded environment won't
* fail in most cases.
*/
if (!LWS_UNIX_SOCK_ENABLED(vhost))
#endif
limit = vhost->context->count_threads; limit = vhost->context->count_threads;
#endif #endif