RPC::Async::URL - Utility functions to handle URLs
use RPC::Async::URL; my $socket1 = url_connect("tcp://220.127.116.11:5678"); my $socket2 = url_connect("open://dir/file.pl", "--my-option"); my ($stdout, $stderr) = url_connect("open2://dir/file.pl", "--my-option"); my ($socket3) = url_connect("unix://mysocket.sock"); my ($socket4) = url_connect("perl://perlsrvd.pl");
Turns an URL into a socket. Currently supported schemes are: * (tcp|udp)://HOST:PORT, Returns a udp of tcp socket. * (unix|unix_dgram)://path/file.sock, Returns a unix domain socket connection. * (perl|perlroot|perl2|perlroot2)(header)?://path/file.pl, Starts a new perl and loads a default header unless it ends in header, then first argument is used as header. It also connects a socket between the two and returns that. Urls with 2 in the end also returns $pid, stdout and stderr. Urls with root in them does not drop root privilages after starting the process the others will. * open2://file, run file and return stdout, stderr and the $pid.
Make urls paths absolute, by adding $cwd to all urls.
Wait for url to disconnect
Explode URL components into smaller bits, only supports tcp and udp.
Same as connect, just returns a listening socket instead. Only tcp://, udp:// and unix:// supported.
Jonas Jensen <firstname.lastname@example.org>, Troels Liebe Bentsen <email@example.com>
Copyright(C) 2005-2007 Troels Liebe Bentsen
Copyright(C) 2005-2007 Jonas Jensen
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.