1Net::Jabber::Server(3)User Contributed Perl DocumentationNet::Jabber::Server(3)
2
3
4
6 Net::Jabber::Server - Jabber Server Library
7
9 Net::Jabber::Server is a module that provides a developer easy access
10 to developing applications that need an embedded Jabber server.
11
13 Server.pm seeks to provide enough high level APIs and automation of
14 the low level APIs that writing and spawning a Jabber Server in Perl
15 is trivial. For those that wish to work with the low level you can
16 do that too, but those functions are covered in the documentation for
17 each module.
18
19 Net::Jabber::Server provides functions to run a full Jabber server that
20 accepts incoming connections and delivers packets to external Jabber
21 servers. You can use all or none of the functions, there is no requirement.
22
23 For more information on how the details for how Net::Jabber is written
24 please see the help for Net::Jabber itself.
25
26 For a full list of high level functions available please see
27 Net::Jabber::Protocol.
28
29 Basic Functions
30
31 use Net::Jabber qw(Server);
32
33 $Server = new Net::Jabber::Server();
34
35 $Server->Start();
36 $Server->Start(jabberxml=>"custom_jabber.xml",
37 hostname=>"foobar.net");
38
39 %status = $Server->Process();
40 %status = $Server->Process(5);
41
42 $Server->Stop();
43
45 Basic Functions
46
47 new(debuglevel=>0⎪1⎪2, - creates the Server object. debugfile
48 debugfile=>string, should be set to the path for the debug
49 debugtime=>0⎪1) log to be written. If set to "stdout"
50 then the debug will go there. debuglevel
51 controls the amount of debug. For more
52 information about the valid setting for
53 debuglevel, debugfile, and debugtime see
54 Net::Jabber::Debug.
55
56 Start(hostname=>string, - starts the server listening on the proper
57 jaberxml=>string) ports. hostname is a quick way of telling
58 the server the hostname to listen on.
59 jabberxml defines the path to a different
60 jabberd configuration file (default is
61 "./jabber.xml").
62
63 Process(integer) - takes the timeout period as an argument. If no
64 timeout is listed then the function blocks until
65 a packet is received. Otherwise it waits that
66 number of seconds and then exits so your program
67 can continue doing useful things. NOTE: This is
68 important for GUIs. You need to leave time to
69 process GUI commands even if you are waiting for
70 packets. The following are the possible return
71 values for each hash entry, and what they mean:
72
73 1 - Status ok, data received.
74 0 - Status ok, no data received.
75 undef - Status not ok, stop processing.
76
77 IMPORTANT: You need to check the output of every
78 Process. If you get an undef then the connection
79 died and you should behave accordingly.
80
81 Stop() - stops the server from running and shuts down all sub programs.
82
84 By Ryan Eatmon in January of 2001 for http://jabber.org.
85
87 This module is free software; you can redistribute it and/or modify it
88 under the same terms as Perl itself.
89
90
91
92perl v5.8.8 2004-08-16 Net::Jabber::Server(3)