diff options
-rwxr-xr-x | prolog/runner/daemon.pl | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/prolog/runner/daemon.pl b/prolog/runner/daemon.pl index b8515b3..36ff846 100755 --- a/prolog/runner/daemon.pl +++ b/prolog/runner/daemon.pl @@ -38,6 +38,15 @@ prolog:error_message(time_limit_exceeded) --> :- set_setting(pengine_sandbox:time_limit, 5.0). :- set_setting(pengine_sandbox:thread_pool_size, 500). -% Start the server. Set fork(true) if you desire for the process to fork into background. You may also want pidfile(filename). -% See /usr/lib/swi-prolog/library/http/http_unix_daemon.pl and thread_httpd.pl for all options. -:- http_daemon([port(3030), ip(localhost), fork(false), workers(10), timeout(30), keep_alive_timeout(30), user(nobody), group(nogroup)]). +start_server :- + Common = [fork(false), workers(10), timeout(30), keep_alive_timeout(30), user(nobody), group(nogroup)], + % SWI-Prolog 7.3.22 changed the options for specifying server address + current_prolog_flag(version, Version), + (Version >= 70322 -> + Options = [http(localhost:3030) | Common] + ; + Options = [ip(localhost), port(3030) | Common] + ), + http_daemon(Options). + +:- start_server. |