.\" Automatically generated by Pod::Man 2.27 (Pod::Simple 3.28) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is turned on, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{ . if \nF \{ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" .\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2). .\" Fear. Run. Save yourself. No user-serviceable parts. . \" fudge factors for nroff and troff .if n \{\ . ds #H 0 . ds #V .8m . ds #F .3m . ds #[ \f1 . ds #] \fP .\} .if t \{\ . ds #H ((1u-(\\\\n(.fu%2u))*.13m) . ds #V .6m . ds #F 0 . ds #[ \& . ds #] \& .\} . \" simple accents for nroff and troff .if n \{\ . ds ' \& . ds ` \& . ds ^ \& . ds , \& . ds ~ ~ . ds / .\} .if t \{\ . ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u" . ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u' . ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u' . ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u' . ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u' . ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u' .\} . \" troff and (daisy-wheel) nroff accents .ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V' .ds 8 \h'\*(#H'\(*b\h'-\*(#H' .ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#] .ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H' .ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u' .ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#] .ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#] .ds ae a\h'-(\w'a'u*4/10)'e .ds Ae A\h'-(\w'A'u*4/10)'E . \" corrections for vroff .if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u' .if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u' . \" for low resolution devices (crt and lpr) .if \n(.H>23 .if \n(.V>19 \ \{\ . ds : e . ds 8 ss . ds o a . ds d- d\h'-1'\(ga . ds D- D\h'-1'\(hy . ds th \o'bp' . ds Th \o'LP' . ds ae ae . ds Ae AE .\} .rm #[ #] #H #V #F C .\" ======================================================================== .\" .IX Title "Net::XMPP::Client 3pm" .TH Net::XMPP::Client 3pm "2014-04-11" "perl v5.18.2" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH "NAME" Net::XMPP::Client \- XMPP Client Module .SH "SYNOPSIS" .IX Header "SYNOPSIS" .Vb 2 \& Net::XMPP::Client is a module that provides a developer easy access \& to the Extensible Messaging and Presence Protocol (XMPP). .Ve .SH "DESCRIPTION" .IX Header "DESCRIPTION" .Vb 5 \& Client.pm uses Protocol.pm to provide enough high level APIs and \& automation of the low level APIs that writing an XMPP Client in \& Perl is trivial. For those that wish to work with the low level \& you can do that too, but those functions are covered in the \& documentation for each module. \& \& Net::XMPP::Client provides functions to connect to an XMPP server, \& login, send and receive messages, set personal information, create \& a new user account, manage the roster, and disconnect. You can use \& all or none of the functions, there is no requirement. \& \& For more information on how the details for how Net::XMPP is written \& please see the help for Net::XMPP itself. \& \& For a full list of high level functions available please see \& Net::XMPP::Protocol. .Ve .SS "Basic Functions" .IX Subsection "Basic Functions" .Vb 1 \& use Net::XMPP; \& \& $Con = new Net::XMPP::Client(); \& \& $Con\->SetCallbacks(...); \& \& $Con\->Execute(hostname=>"jabber.org", \& username=>"bob", \& password=>"XXXX", \& resource=>"Work\*(Aq \& ); \& \& # \& # For the list of available functions see Net::XMPP::Protocol. \& # \& \& $Con\->Disconnect(); .Ve .SH "METHODS" .IX Header "METHODS" .SS "Basic Functions" .IX Subsection "Basic Functions" .Vb 8 \& new(debuglevel=>0|1|2, \- creates the Client object. debugfile \& debugfile=>string, should be set to the path for the debug \& debugtime=>0|1) log to be written. If set to "stdout" \& then the debug will go there. debuglevel \& controls the amount of debug. For more \& information about the valid setting for \& debuglevel, debugfile, and debugtime see \& Net::XMPP::Debug. \& \& Connect(hostname=>string, \- opens a connection to the server \& port=>integer, listed in the hostname (default \& timeout=>int localhost), on the port (default \& connectiontype=>string, 5222) listed, using the \& tls=>0|1, connectiontype listed (default \& srv=>0|1, tcpip). The two connection types \& componentname=>string) available are: \& tcpip standard TCP socket \& http TCP socket, but with the \& headers needed to talk \& through a web proxy \& If you specify tls, then it TLS \& will be used if it is available \& as a feature. \& \& If srv is specified AND Net::DNS is \& installed and can be loaded, then \& an SRV query is sent to srv.hostname \& and the results processed to replace \& the hostname and port. If the lookup \& fails, or Net::DNS cannot be loaded, \& then hostname and port are left alone \& as the defaults. \& \& Alternatively, you may manually specify \& componentname as the domain portion of the \& jid and leave hostname set to the actual \& hostname of the XMPP server. \& \& Execute(hostname=>string, \- Generic inner loop to handle \& port=>int, connecting to the server, calling \& tls=>0|1, Process, and reconnecting if the \& username=>string, connection is lost. There are \& password=>string, five callbacks available that are \& resource=>string, called at various places: \& register=>0|1, onconnect \- when the client has \& connectiontype=>string, made a connection. \& connecttimeout=>string, onauth \- when the connection is \& connectattempts=>int, made and user has been \& connectsleep=>int, authed. Essentially, \& processtimeout=>int) this is when you can \& start doing things \& as a Client. Like \& send presence, get your \& roster, etc... \& onprocess \- this is the most \& inner loop and so \& gets called the most. \& Be very very careful \& what you put here \& since it can \& *DRASTICALLY* affect \& performance. \& ondisconnect \- when the client \& disconnects from \& the server. \& onexit \- when the function gives \& up trying to connect and \& exits. \& The arguments are passed straight \& on to the Connect function, except \& for connectattempts and connectsleep. \& connectattempts is the number of \& times that the Component should try \& to connect before giving up. \-1 \& means try forever. The default is \& \-1. connectsleep is the number of \& seconds to sleep between each \& connection attempt. \& \& If you specify register=>1, then the \& Client will attempt to register the \& sepecified account for you, if it \& does not exist. \& \& Process(integer) \- takes the timeout period as an argument. If no \& timeout is listed then the function blocks until \& a packet is received. Otherwise it waits that \& number of seconds and then exits so your program \& can continue doing useful things. NOTE: This is \& important for GUIs. You need to leave time to \& process GUI commands even if you are waiting for \& packets. The following are the possible return \& values, 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 every \& Process. If you get an undef then the connection \& died and you should behave accordingly. \& \& Disconnect() \- closes the connection to the server. \& \& Connected() \- returns 1 if the Transport is connected to the server, \& and 0 if not. .Ve .SH "AUTHOR" .IX Header "AUTHOR" Ryan Eatmon .SH "COPYRIGHT" .IX Header "COPYRIGHT" This module is free software, you can redistribute it and/or modify it under the \s-1LGPL.\s0