leostereo has asked for the wisdom of the Perl Monks concerning the following question:

After build a basic soap server as described in documentation:

!/usr/bin/perl -w use Proc::Daemon; use Proc::PID::File; use SOAP::Transport::HTTP; { my $port = 8888; my $daemon = SOAP::Transport::HTTP::Daemon ->new(LocalPort => 8888, Reuse => 1) ->dispatch_to('MY_API::Bridge'); print $daemon->url, "\n"; $daemon->handle; }

Server works good, my Bridge module just return some values. I have noticed that every time I perform a soap query for instance using curl, there is a new server instance created. Is it normal? After one hour I need to killall the instances and restart the server. Is there some way to avoid the server creat and mantain living processes for each query ? Regards. Leandro.

Replies are listed 'Best First'.
Re: soap server with SOAP::Transport::HTTP module
by Corion (Patriarch) on Oct 07, 2015 at 18:38 UTC

    Do you "launch" this script through your webserver? Or do you launch this program first and then access it at port 8888?

      Thanks for your response. Im not using any browser for this. Im just usin http to transport soap messajes just for legacy comptability. What I do is to execute the daemon from command line Then I can check that server is listening at por 8888. and then I test it with a "telnet localhost 8888" or a curl client. Both give me same result.

Re: soap server with SOAP::Transport::HTTP module
by Anonymous Monk on Oct 07, 2015 at 22:18 UTC
    This script implements a daemon that expects to survive.

      I agree with that ... but I expected that his child proccess finished when script finished.

      I have same implementation using apache/php and there is only one instance of the server.

        Use a different transport (like CGI), or end/kill the server after you're finished with it
A reply falls below the community's threshold of quality. You may see it by logging in.