Scroll to navigation

Net::Async::Tangence::Client(3pm) User Contributed Perl Documentation Net::Async::Tangence::Client(3pm)

NAME

"Net::Async::Tangence::Client" - connect to a "Tangence" server using "IO::Async"

DESCRIPTION

This subclass of Net::Async::Tangence::Protocol connects to a Tangence server, allowing the client program to access exposed objects in the server. It is a concrete implementation of the "Tangence::Client" mixin.

The following documentation concerns this specific implementation of the client; for more general information on the "Tangence"-specific parts of this class, see instead the documentation for Tangence::Client.

PARAMETERS

The following named parameters may be passed to "new" or "configure":

The identity string to send to the server.
Default error-handling policy for method calls. If set to either of the strings "carp" or "croak" then a CODE ref will be created that invokes the given function from "Carp"; otherwise must be a CODE ref.

METHODS

The following methods documented with a trailing call to "->get" return Future instances.

connect_url

   $rootobj = $client->connect_url( $url, %args )->get

Connects to a "Tangence" server at the given URL. The returned Future will yield the root object proxy once it has been obtained.

Takes the following named arguments:

Invoked once the registry and root object proxies have been obtained from the server. See the documentation the Tangence::Client "tangence_connected" method.
Optional. May be set to "inet4" or "inet6" to force IPv4 or IPv6 if relevant. Ignored by "exec:" and "unix:" schemes.

The following URL schemes are recognised:

  • exec

    Directly executes the server as a child process. This is largely provided for testing purposes, as the server will only run for this one client; it will exit when the client disconnects.

     exec:///path/to/command?with+arguments
        

    The URL's path should point to the required command, and the query string will be split on "+" signs and used as the arguments. The authority section of the URL will be ignored, so may be left empty.

  • sshexec

    A convenient wrapper around the "exec" scheme, to connect to a server running remotely via ssh.

     sshexec://host/path/to/command?with+arguments
        

    The URL's authority section will give the SSH server (and optionally username), and the path and query sections will be used as for "exec".

    (This scheme is also available as "ssh", though this name is now deprecated)

  • tcp

    Connects to a server via a TCP socket.

     tcp://host:port/
        

    The URL's authority section will be used to give the server's hostname and port number. The other sections of the URL will be ignored.

  • unix

    Connects to a server via a UNIX local socket.

     unix:///path/to/socket
        

    The URL's path section will give the path to the local socket. The other sections of the URL will be ignored.

  • sshunix

    Connects to a server running remotely via a UNIX socket over ssh.

     sshunix://host/path/to/socket
        

    (This is implemented by running perl remotely and sending it a tiny self-contained program that connects STDIN/STDOUT to the given UNIX socket path. It requires that the server has perl at least version 5.6 available in the path simply as "perl")

AUTHOR

Paul Evans <leonerd@leonerd.org.uk>

2022-09-10 perl v5.34.0