Subject: | bug with port declaration in config file |
When specifying 'port = 20204' in the config file and requesting a 'Net::Server::PreForkSimple' then a 'Address already in use' error is generated.
After adding some debug statements to 'Server.pm' then the following appears in the log file:
process_args(): log_level = 4
process_args(): pid_file = mywebserver.pid
process_args(): port = 20204 (array)
Becoming sub class of "Net::Server::PreForkSimple"
process_args()
calling process_conf()
calling process_args()
process_args()
process_args(): max_servers = 5
process_args(): max_requests = 1000
process_args(): log_level = 4
process_args(): pid_file = mywebserver.pid
process_args(): port = 20204 (array)
pre_bind()
2003/08/06-05:34:17 RPC::XML::Server (type Net::Server::MultiType) starting! pid(4891)
pre_bind(): port: 20204
pre_bind(): port: 20204
Binding to TCP port 20204 on host *
Binding to TCP port 20204 on host *
2003/08/06-05:34:17 Can't connect to TCP port 20204 on * [Address already in use]
at line 86 in file /usr/lib/perl5/site_perl/5.8.0/Net/Server/Proto/TCP.pm
2003/08/06-05:34:17 Server closing!
It appears that the configuration file is digested twice (why?) and this results in two protocol objects using the same port... and the error.
How to fix this cleanly?