diff options
author | Matthew Wild <mwild1@gmail.com> | 2020-06-01 13:43:35 +0100 |
---|---|---|
committer | Matthew Wild <mwild1@gmail.com> | 2020-06-01 13:43:35 +0100 |
commit | a353d19e23d440036324c9ecb8058fbaf7a11b9c (patch) | |
tree | 724f9487d0dd311e1b0b2e3f38b91f9e792f795e /net/server.lua | |
parent | 1bf7e0fcf72bfbc5b1544d08dff1d520284fce7d (diff) | |
download | prosody-a353d19e23d440036324c9ecb8058fbaf7a11b9c.tar.gz prosody-a353d19e23d440036324c9ecb8058fbaf7a11b9c.zip |
net.server: Switch to epoll backend by default
(if util.poll is found)
Diffstat (limited to 'net/server.lua')
-rw-r--r-- | net/server.lua | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/net/server.lua b/net/server.lua index abbb421d..f5666594 100644 --- a/net/server.lua +++ b/net/server.lua @@ -13,7 +13,11 @@ if not (prosody and prosody.config_loaded) then end local log = require "util.logger".init("net.server"); -local server_type = require "core.configmanager".get("*", "network_backend") or "select"; + +local have_util_poll = pcall(require, "util.poll"); +local default_backend = have_util_poll and "epoll" or "select"; + +local server_type = require "core.configmanager".get("*", "network_backend") or default_backend; if require "core.configmanager".get("*", "use_libevent") then server_type = "event"; |