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

I'm using Frontier::Daemon to make a xmlrpc server. I need to pass the ip address of the connecting client to one of the methods.

I start the daemon like this:
my $methods = {'test' => \&test, 'echotest' => \&echotest, 'pleaseNotify'=> \&pleaseNotify }; Frontier::Daemon->new( LocalPort => $listeningport, methods => $methods);
And then define the methods as subs. Taking the attributes from the xmlrpc call via
 ($attr1, $attr2, $attr3) = @_

So far so good. But I need to pull out the ip address of the client at the same time.

Does anyone know how to do this with Frontier::Daemon? Much pintage available to anyone who does...

Replies are listed 'Best First'.
(tye)Re: hostname under Frontier::Daemon
by tye (Sage) on Mar 14, 2002 at 19:53 UTC

    The documentation for Frontier::Daemon says:

    Frontier::Daemon is a subclass of HTTP::Daemon, which is a subclass of IO::Socket::INET.

    And IO::Socket::INET's documentation mentions a peeraddr() method. So $obj->peeraddr() may be useful [where $obj is value returned by Frontier::Daemon->new()]. I haven't tested this.

            - tye (but my friends call me "Tye")