Comparison

net/server.lua @ 11763:e273ef869794

net.server: Pikc server_epoll as unconditional default Previously it would have gone for server_select if util.poll was for some reason not available, which should be never these days. And even if it was, best to flush it out by throwing loud errors so users notice. Then they can work around it by using select until we delete that one.
author Kim Alvefur <zash@zash.se>
date Fri, 03 Sep 2021 17:39:00 +0200
parent 11762:54530085dffe
child 11764:e2650d59db2d
comparison
equal deleted inserted replaced
11762:54530085dffe 11763:e273ef869794
12 error(debug.traceback("Loading outside Prosody or Prosody not yet initialized"), 0); 12 error(debug.traceback("Loading outside Prosody or Prosody not yet initialized"), 0);
13 end 13 end
14 14
15 local log = require "util.logger".init("net.server"); 15 local log = require "util.logger".init("net.server");
16 16
17 local have_util_poll = pcall(require, "util.poll"); 17 local default_backend = "epoll";
18 local default_backend = have_util_poll and "epoll" or "select";
19 18
20 local server_type = require "core.configmanager".get("*", "network_backend") or default_backend; 19 local server_type = require "core.configmanager".get("*", "network_backend") or default_backend;
21 20
22 if require "core.configmanager".get("*", "use_libevent") then 21 if require "core.configmanager".get("*", "use_libevent") then
23 server_type = "event"; 22 server_type = "event";