{
    "content": [
        {
            "type": "text",
            "text": "# Net::XMPP::Client (perldoc)\n\n## NAME\n\nNet::XMPP::Client - XMPP Client Module\n\n## SYNOPSIS\n\nNet::XMPP::Client is a module that provides a developer easy access to the Extensible Messaging\nand Presence Protocol (XMPP).\n\n## DESCRIPTION\n\nClient.pm uses Protocol.pm to provide enough high level APIs and automation of the low level\nAPIs that writing an XMPP Client in Perl is trivial. For those that wish to work with the low\nlevel you can do that too, but those functions are covered in the documentation for each module.\n\n## Sections\n\n- **NAME**\n- **SYNOPSIS**\n- **DESCRIPTION** (1 subsections)\n- **METHODS**\n- **Basic Functions** (5 subsections)\n- **AUTHOR**\n- **COPYRIGHT**\n\nUse structuredContent.sections for detailed options, examples, and full documentation.\n"
        }
    ],
    "structuredContent": {
        "command": "Net::XMPP::Client",
        "section": "",
        "mode": "perldoc",
        "summary": "Net::XMPP::Client - XMPP Client Module",
        "synopsis": "Net::XMPP::Client is a module that provides a developer easy access to the Extensible Messaging\nand Presence Protocol (XMPP).",
        "tldr_summary": null,
        "tldr_examples": [],
        "tldr_source": null,
        "flags": [],
        "examples": [],
        "see_also": [],
        "section_outline": [
            {
                "name": "NAME",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "SYNOPSIS",
                "lines": 3,
                "subsections": []
            },
            {
                "name": "DESCRIPTION",
                "lines": 13,
                "subsections": [
                    {
                        "name": "Basic Functions",
                        "lines": 16
                    }
                ]
            },
            {
                "name": "METHODS",
                "lines": 1,
                "subsections": []
            },
            {
                "name": "Basic Functions",
                "lines": 10,
                "subsections": [
                    {
                        "name": "Connect",
                        "lines": 26
                    },
                    {
                        "name": "Execute",
                        "lines": 53
                    },
                    {
                        "name": "Process",
                        "lines": 15
                    },
                    {
                        "name": "Disconnect",
                        "lines": 4
                    },
                    {
                        "name": "Connected",
                        "lines": 4
                    }
                ]
            },
            {
                "name": "AUTHOR",
                "lines": 6,
                "subsections": []
            },
            {
                "name": "COPYRIGHT",
                "lines": 2,
                "subsections": []
            }
        ],
        "sections": {
            "NAME": {
                "content": "Net::XMPP::Client - XMPP Client Module\n",
                "subsections": []
            },
            "SYNOPSIS": {
                "content": "Net::XMPP::Client is a module that provides a developer easy access to the Extensible Messaging\nand Presence Protocol (XMPP).\n",
                "subsections": []
            },
            "DESCRIPTION": {
                "content": "Client.pm uses Protocol.pm to provide enough high level APIs and automation of the low level\nAPIs that writing an XMPP Client in Perl is trivial. For those that wish to work with the low\nlevel you can do that too, but those functions are covered in the documentation for each module.\n\nNet::XMPP::Client provides functions to connect to an XMPP server, login, send and receive\nmessages, set personal information, create a new user account, manage the roster, and\ndisconnect. You can use all or none of the functions, there is no requirement.\n\nFor more information on how the details for how Net::XMPP is written please see the help for\nNet::XMPP itself.\n\nFor a full list of high level functions available please see Net::XMPP::Protocol.\n",
                "subsections": [
                    {
                        "name": "Basic Functions",
                        "content": "use Net::XMPP;\n\n$Con = Net::XMPP::Client->new();\n\n$Con->SetCallbacks(...);\n\n$Con->Execute(hostname=>\"jabber.org\",\nusername=>\"bob\",\npassword=>\"XXXX\",\nresource=>\"Work\"\n);\n\nFor the list of available functions see Net::XMPP::Protocol.\n\n$Con->Disconnect();\n"
                    }
                ]
            },
            "METHODS": {
                "content": "",
                "subsections": []
            },
            "Basic Functions": {
                "content": "new\nnew(debuglevel=>0|1|2,\ndebugfile=>string,\ndebugtime=>0|1)\n\ncreates the Client object. debugfile should be set to the path for the debug log to be written.\nIf set to \"stdout\" then the debug will go there. debuglevel controls the amount of debug. For\nmore information about the valid setting for debuglevel, debugfile, and debugtime see\nNet::XMPP::Debug.\n",
                "subsections": [
                    {
                        "name": "Connect",
                        "content": "Connect(hostname=>string,\nport=>integer,\ntimeout=>int,\nconnectiontype=>string,\ntls=>0|1,\nsrv=>0|1,\ncomponentname=>string)\n\nopens a connection to the server listed in the hostname (default localhost), on the port\n(default 5222) listed, using the connectiontype listed (default tcpip). The two connection types\navailable are:\n\ntcpip  standard TCP socket\nhttp   TCP socket, but with the\nheaders needed to talk\nthrough a web proxy\n\nIf you specify tls, then it TLS will be used if it is available as a feature.\n\nIf srv is specified AND Net::DNS is installed and can be loaded, then an SRV query is sent to\nsrv.hostname and the results processed to replace the hostname and port. If the lookup fails, or\nNet::DNS cannot be loaded, then hostname and port are left alone as the defaults.\n\nAlternatively, you may manually specify componentname as the domain portion of the jid and leave\nhostname set to the actual hostname of the XMPP server.\n"
                    },
                    {
                        "name": "Execute",
                        "content": "Execute(hostname=>string,\nport=>int,\ntls=>0|1,\nusername=>string,\npassword=>string,\nresource=>string,\nregister=>0|1,\nconnectiontype=>string,\nconnecttimeout=>string,\nconnectattempts=>int,\nconnectsleep=>int,\nprocesstimeout=>int)\n\nGeneric inner loop to handle connecting to the server, calling Process, and reconnecting if the\nconnection is lost. There are five callbacks available that are called at various places:\n\nonconnect - when the client has\nmade a connection.\n\nonauth - when the connection is\nmade and user has been\nauthed.  Essentially,\nthis is when you can\nstart doing things\nas a Client.  Like\nsend presence, get your\nroster, etc...\n\nonprocess - this is the most\ninner loop and so\ngets called the most.\nBe very very careful\nwhat you put here\nsince it can\n*DRASTICALLY* affect\nperformance.\n\nondisconnect - when the client\ndisconnects from\nthe server.\n\nonexit - when the function gives\nup trying to connect and\nexits.\n\nThe arguments are passed straight on to the Connect function, except for connectattempts and\nconnectsleep. connectattempts is the number of times that the Component should try to connect\nbefore giving up. -1 means try forever. The default is -1. connectsleep is the number of seconds\nto sleep between each connection attempt.\n\nIf you specify register=>1, then the Client will attempt to register the sepecified account for\nyou, if it does not exist.\n"
                    },
                    {
                        "name": "Process",
                        "content": "Process(integer)\n\ntakes the timeout period as an argument. If no timeout is listed then the function blocks until\na packet is received. Otherwise it waits that number of seconds and then exits so your program\ncan continue doing useful things. NOTE: This is important for GUIs. You need to leave time to\nprocess GUI commands even if you are waiting for packets. The following are the possible return\nvalues, and what they mean:\n\n1   - Status ok, data received.\n0   - Status ok, no data received.\nundef - Status not ok, stop processing.\n\nIMPORTANT: You need to check the output of every Process. If you get an undef then the\nconnection died and you should behave accordingly.\n"
                    },
                    {
                        "name": "Disconnect",
                        "content": "Disconnect()\n\ncloses the connection to the server.\n"
                    },
                    {
                        "name": "Connected",
                        "content": "Connected()\n\nreturns 1 if the Transport is connected to the server, and 0 if not.\n"
                    }
                ]
            },
            "AUTHOR": {
                "content": "Originally authored by Ryan Eatmon.\n\nPreviously maintained by Eric Hacker.\n\nCurrently maintained by Darian Anthony Patrick.\n",
                "subsections": []
            },
            "COPYRIGHT": {
                "content": "This module is free software, you can redistribute it and/or modify it under the LGPL 2.1.\n",
                "subsections": []
            }
        }
    }
}