JSONRPC::Transport::TCP - Client component for TCP JSONRPC
use JSONRPC::Transport::TCP; my $rpc = JSONRPC::Transport::TCP->new( host => '127.0.0.1', port => 3000 ); my $res = $rpc->call('echo', 'arg1', 'arg2' ) or die $rpc->error; print $res->result;
This module is a simple client side implementation about JSONRPC via TCP.
This module doesn't support continual tcp streams, and so it open/close connection on each request.
Create new client object.
- host => 'Str'
Hostname or ip address to connect.
This should be set 'unix/' when you want to connect to unix socket.
- port => 'Int | Str'
Port number or unix socket path to connect
Connect remote host.
This module automatically connect on following "call" method, so you have not to call this method.
Disconnect the connection
Call remote method.
When remote method is success, it returns self object that contains result as ->result accessor.
If some error are occurred, it returns undef, and you can check the error by ->error accessor.
Automatically disconnect when object destroy.
Contains result of remote method
Contains error of remote method
Daisuke Murase <email@example.com>
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
The full text of the license can be found in the LICENSE file included with this module.