{
    "content": [
        {
            "type": "text",
            "text": "# Net::Jabber::Component (perldoc)\n\n## NAME\n\nNet::Jabber::Component - Jabber Component Library\n\n## SYNOPSIS\n\nNet::Jabber::Component is a module that provides a developer easy\naccess to developing server components in the Jabber Instant Messaging\nprotocol.\n\n## DESCRIPTION\n\nComponent.pm seeks to provide enough high level APIs and automation of\nthe low level APIs that writing a Jabber Component in Perl is trivial.\nFor those that wish to work with the low level you can do that too,\nbut those functions are covered in the documentation for each module.\n\n## Sections\n\n- **NAME**\n- **SYNOPSIS**\n- **DESCRIPTION** (1 subsections)\n- **METHODS** (1 subsections)\n- **AUTHOR**\n- **COPYRIGHT**\n\nUse structuredContent.sections for detailed options, examples, and full documentation.\n"
        }
    ],
    "structuredContent": {
        "command": "Net::Jabber::Component",
        "section": "",
        "mode": "perldoc",
        "summary": "Net::Jabber::Component - Jabber Component Library",
        "synopsis": "Net::Jabber::Component is a module that provides a developer easy\naccess to developing server components in the Jabber Instant Messaging\nprotocol.",
        "tldr_summary": null,
        "tldr_examples": [],
        "tldr_source": null,
        "flags": [],
        "examples": [],
        "see_also": [],
        "section_outline": [
            {
                "name": "NAME",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "SYNOPSIS",
                "lines": 4,
                "subsections": []
            },
            {
                "name": "DESCRIPTION",
                "lines": 16,
                "subsections": [
                    {
                        "name": "Basic Functions",
                        "lines": 15
                    }
                ]
            },
            {
                "name": "METHODS",
                "lines": 1,
                "subsections": [
                    {
                        "name": "Basic Functions",
                        "lines": 94
                    }
                ]
            },
            {
                "name": "AUTHOR",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "COPYRIGHT",
                "lines": 3,
                "subsections": []
            }
        ],
        "sections": {
            "NAME": {
                "content": "Net::Jabber::Component - Jabber Component Library\n",
                "subsections": []
            },
            "SYNOPSIS": {
                "content": "Net::Jabber::Component is a module that provides a developer easy\naccess to developing server components in the Jabber Instant Messaging\nprotocol.\n",
                "subsections": []
            },
            "DESCRIPTION": {
                "content": "Component.pm seeks to provide enough high level APIs and automation of\nthe low level APIs that writing a Jabber Component in Perl is trivial.\nFor those that wish to work with the low level you can do that too,\nbut those functions are covered in the documentation for each module.\n\nNet::Jabber::Component provides functions to connect to a Jabber\nserver, login, send and receive messages, operate as a server side\ncomponent, and disconnect.  You can use all or none of the functions,\nthere is no requirement.\n\nFor more information on how the details for how Net::Jabber is written\nplease see the help for Net::Jabber itself.\n\nFor a full list of high level functions available please see\nNet::Jabber::Protocol and Net::XMPP::Protocol.\n",
                "subsections": [
                    {
                        "name": "Basic Functions",
                        "content": "use Net::Jabber;\n\n$Con = new Net::Jabber::Component();\n\n$Con->Execute(hostname=>\"jabber.org\",\ncomponentname=>\"service.jabber.org\",\nsecret=>\"XXXX\"\n);\n\n#\n# For the list of available functions see Net::XMPP::Protocol.\n#\n\n$Con->Disconnect();\n"
                    }
                ]
            },
            "METHODS": {
                "content": "",
                "subsections": [
                    {
                        "name": "Basic Functions",
                        "content": "new(debuglevel=>0|1|2, - creates the Component object.  debugfile\ndebugfile=>string,   should be set to the path for the debug\ndebugtime=>0|1)      log to be written.  If set to \"stdout\"\nthen the debug will go there.  debuglevel\ncontrols the amount of debug.  For more\ninformation about the valid setting for\ndebuglevel, debugfile, and debugtime see\nNet::Jabber::Debug.\n\nAuthSend(secret=>string) - Perform the handshake and authenticate\nwith the server.\n\nConnect(hostname=>string,       - opens a connection to the server\nport=>integer,            based on the value of\ncomponentname=>string,    connectiontype.  The only valid\nconnectiontype=>string)   setting is:\naccept - TCP/IP remote connection\nIn the future this might be used\nagain by offering new features.\nIf accept then it connects to the\nserver listed in the hostname\nvalue, on the port listed.  The\ndefaults for the two are localhost\nand 5269.\n\nNote: A change from previous\nversions is that Component now\nshares its core with Client.  To\nthat end, the secret should no\nlonger be used.  Call AuthSend\nafter connecting.  Better yet,\nuse Execute.\n\nConnected() - returns 1 if the Component is connected to the server,\nand 0 if not.\n\nDisconnect() - closes the connection to the server.\n\nExecute(hostname=>string,       - Generic inner loop to handle\nport=>int,                connecting to the server, calling\nsecret=>string,           Process, and reconnecting if the\ncomponentname=>string,    connection is lost.  There are four\nconnectiontype=>string,   callbacks available that are called\nconnectattempts=>int,     at various places in the loop.\nconnectsleep=>int)          onconnect - when the component\nconnects to the\nserver.\nonauth - when the component has\ncompleted its handshake\nwith the server this\nwill be called.\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.\nondisconnect - when connection is\nlost.\nonexit - when the function gives\nup trying to connect and\nexits.\nThe arguments are passed straight\non to the Connect function, except\nfor connectattempts and\nconnectsleep.  connectattempts is\nthe number of time that the\nComponent should try to connect\nbefore giving up.  -1 means try\nforever.  The default is -1.\nconnectsleep is the number of\nseconds to sleep between each\nconnection attempt.\n\nProcess(integer) - takes the timeout period as an argument.  If no\ntimeout is listed then the function blocks until\na packet is received.  Otherwise it waits that\nnumber of seconds and then exits so your program\ncan continue doing useful things.  NOTE: This is\nimportant for GUIs.  You need to leave time to\nprocess GUI commands even if you are waiting for\npackets.  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\nProcess.  If you get an undef then the connection\ndied and you should behave accordingly.\n"
                    }
                ]
            },
            "AUTHOR": {
                "content": "Ryan Eatmon\n",
                "subsections": []
            },
            "COPYRIGHT": {
                "content": "This module is free software; you can redistribute it and/or modify it under the same terms as\nPerl itself.\n",
                "subsections": []
            }
        }
    }
}