DJ Adams > Jabber-RPC > Jabber::RPC::Server

Download:
Jabber-RPC-0.01.tar.gz

Dependencies

Annotate this POD

CPAN RT

New  1
Open  0
View/Report Bugs
Source  

NAME ^

Jabber::RPC::Server - Jabber-RPC Server

SYNOPSIS ^

  use Jabber::RPC::Server;

  sub function1 {
    ...
  }

  sub function2 {
    ...
  }

  # Server as Jabber component
  my $server = new Jabber::RPC::Server(
    server         => 'myserver.org:5702',
    identauth      => 'jrpc.myserver.org:secret',
    connectiontype => 'component',
    methods        => { 
                        'rpc.function1' => \&function1,
                        'rpc.function2' => \&function2,
                      } 
  );  

  # or ...

  # Server as Jabber client
  my $server = new Jabber::RPC::Server(
    server    => 'myserver.org',
    identauth => 'id:secret',
    resource  => 'jrpc-server',
    methods   => { 
                   'rpc.function1' => \&function1,
                   'rpc.function2' => \&function2,
                 } 
  );  


  $server->start;

DESCRIPTION ^

Jabber::RPC::Server is an implementation of a Jabber-RPC server. A Jabber-RPC server receives XML-RPC-encoded calls carried over Jabber and responds to them.

You can have your Jabber::RPC::Server connect as a Jabber component or as a Jabber client - see the differences in the SYNOPSIS example above. (One difference is that you need to specify connectiontype => 'component' for a Jabber component connection - the default assumption is that you want to connect as a Jabber client.)

If you don't specify a value for the 'resource' argument (in the SYNOPSIS example, a value is specified for the Jabber client 'flavour' but not for the Jabber component 'flavour') then the default of 'jrpc-server' will be used.

VERSION ^

early

AUTHOR ^

DJ Adams

SEE ALSO ^

Jabber::RPC::Client, Jabber::Connection

syntax highlighting: