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 use Net::Jabber qw(Server);
31
32 $Server = new Net::Jabber::Server();
33
34 $Server->Start();
35 $Server->Start(jabberxml=>"custom_jabber.xml",
36 hostname=>"foobar.net");
37
38 %status = $Server->Process();
39 %status = $Server->Process(5);
40
41 $Server->Stop();
42
44 Basic Functions
45 new(debuglevel=>0|1|2, - creates the Server object. debugfile
46 debugfile=>string, should be set to the path for the debug
47 debugtime=>0|1) log to be written. If set to "stdout"
48 then the debug will go there. debuglevel
49 controls the amount of debug. For more
50 information about the valid setting for
51 debuglevel, debugfile, and debugtime see
52 Net::Jabber::Debug.
53
54 Start(hostname=>string, - starts the server listening on the proper
55 jaberxml=>string) ports. hostname is a quick way of telling
56 the server the hostname to listen on.
57 jabberxml defines the path to a different
58 jabberd configuration file (default is
59 "./jabber.xml").
60
61 Process(integer) - takes the timeout period as an argument. If no
62 timeout is listed then the function blocks until
63 a packet is received. Otherwise it waits that
64 number of seconds and then exits so your program
65 can continue doing useful things. NOTE: This is
66 important for GUIs. You need to leave time to
67 process GUI commands even if you are waiting for
68 packets. The following are the possible return
69 values for each hash entry, and what they mean:
70
71 1 - Status ok, data received.
72 0 - Status ok, no data received.
73 undef - Status not ok, stop processing.
74
75 IMPORTANT: You need to check the output of every
76 Process. If you get an undef then the connection
77 died and you should behave accordingly.
78
79 Stop() - stops the server from running and shuts down all sub programs.
80
82 By Ryan Eatmon in January of 2001 for http://jabber.org.
83
85 This module is free software; you can redistribute it and/or modify it
86 under the same terms as Perl itself.
87
88
89
90perl v5.34.0 2021-07-22 Net::Jabber::Server(3)