NAME
Net::Jabber::Server - Jabber Server Library
SYNOPSIS
Net::Jabber::Server is a module that provides a developer easy accessto developing applications that need an embedded Jabber server.
DESCRIPTION
Server.pm seeks to provide enough high level APIs and automation ofthe low level APIs that writing and spawning a Jabber Server in Perlis trivial. For those that wish to work with the low level you cando that too, but those functions are covered in the documentation foreach module.Net::Jabber::Server provides functions to run a full Jabber server thataccepts incoming connections and delivers packets to external Jabberservers. You can use all or none of the functions, there is no requirement.For more information on how the details for how Net::Jabber is writtenplease see the help for Net::Jabber itself.For a full list of high level functions available please seeNet::Jabber::Protocol.
Basic Functions
use Net::Jabber qw(Server);$Server = new Net::Jabber::Server();$Server->Start();$Server->Start(jabberxml=>"custom_jabber.xml",hostname=>"foobar.net");%status = $Server->Process();%status = $Server->Process(5);$Server->Stop();
METHODS
Basic Functions
new(debuglevel=>0|1|2, - creates the Server object. debugfiledebugfile=>string, should be set to the path for the debugdebugtime=>0|1) log to be written. If set to "stdout"then the debug will go there. debuglevelcontrols the amount of debug. For moreinformation about the valid setting fordebuglevel, debugfile, and debugtime seeNet::Jabber::Debug.Start(hostname=>string, - starts the server listening on the properjaberxml=>string) ports. hostname is a quick way of tellingthe server the hostname to listen on.jabberxml defines the path to a differentjabberd configuration file (default is"./jabber.xml").Process(integer) - takes the timeout period as an argument. If notimeout is listed then the function blocks untila packet is received. Otherwise it waits thatnumber of seconds and then exits so your programcan continue doing useful things. NOTE: This isimportant for GUIs. You need to leave time toprocess GUI commands even if you are waiting forpackets. The following are the possible returnvalues for each hash entry, and what they mean:1 - Status ok, data received.0 - Status ok, no data received.undef - Status not ok, stop processing.IMPORTANT: You need to check the output of everyProcess. If you get an undef then the connectiondied and you should behave accordingly.Stop() - stops the server from running and shuts down all sub programs.
AUTHOR
By Ryan Eatmon in January of 2001 for http://jabber.org.
COPYRIGHT
This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself.