Net::J...ection(3pm)

✨ NAME ✨

okay so bestie, welcome to Net::Jabber::Loudmouth::Connection β€” it's a whole Jabber connection, literally the main character of your XMPP era πŸ’…

(and yes, this page is from the User Contributed Perl Documentation, section 3pm, in case you were wondering where it lives πŸ‘‘)


🌸 HIERARCHY 🌸

she's a boxed type and she knows it:

Glib::Boxed
+----Net::Jabber::Loudmouth::Connection

πŸŽ€ METHODS πŸŽ€

every single one of them, no skips, we don't do that here 🫢

  • connection = Net::Jabber::Loudmouth::Connection->new ($server) β€” make a brand new connection object
    • $server (string)
  • connection = Net::Jabber::Loudmouth::Connection->new_with_context ($server, $context) β€” same energy, but you hand it a context too
    • $server (string)
    • $context (Glib::MainContext thingamabob)
  • boolean = $connection->authenticate ($username, $password, $resource, $auth_cb, $user_data=undef) β€” log in, and hand it a callback while you're at it
    • $username (string)
    • $password (string)
    • $resource (string)
    • $auth_cb (scalar)
    • $user_data (scalar)
  • boolean = $connection->authenticate_and_block ($username, $password, $resource) β€” authenticate but it just waits, no callback, no vibes, just blocking 😭
    • $username (string)
    • $password (string)
    • $resource (string)
  • $connection->cancel_open β€” nvm, cancel that open
  • boolean = $connection->close β€” shut it down
  • $connection->set_disconnect_function ($disconnect_cb, $user_data=undef) β€” what should happen when she disconnects
    • $disconnect_cb (scalar)
    • $user_data (scalar)
  • boolean = $connection->is_authenticated β€” are we authed or not, bestie?
  • boolean = $connection->is_open β€” is the connection open?
  • string = $connection->get_jid β€” gimme the JID
  • $connection->set_jid ($jid) β€” set the JID
    • $jid (string)
  • $connection->set_keep_alive_rate ($rate) β€” how often she pings to stay alive
    • $rate (integer)
  • boolean = $connection->open ($result_cb, $user_data=undef) β€” open it up, with a result callback
    • $result_cb (scalar)
    • $user_data (scalar)
  • boolean = $connection->open_and_block β€” open, but blocking, no callback, just sitting there waiting πŸ’€
  • integer = $connection->get_port β€” which port we on?
  • $connection->set_port ($port) β€” set the port
    • $port (integer)
  • proxy = $connection->get_proxy β€” gimme the proxy
  • $connection->set_proxy ($proxy) β€” set the proxy
    • $proxy (Net::Jabber::Loudmouth::Proxy or undef)
  • messagehandler = $connection->register_message_handler ($type, $priority, $handler_cb, $user_data=undef) β€” sign a handler up for a specific message type, with a priority
    • $type (Net::Jabber::Loudmouth::MessageType)
    • $priority (Net::Jabber::Loudmouth::HandlerPriority)
    • $handler_cb (scalar)
    • $user_data (scalar)
  • boolean = $connection->send ($message) β€” send a message
    • $message (Net::Jabber::Loudmouth::Message)
  • boolean = $connection->send_raw ($str) β€” send a raw string, straight up, no filter
    • $str (string)
  • boolean = $connection->send_with_reply ($message, $handler) β€” send it and get a reply through a handler
    • $message (Net::Jabber::Loudmouth::Message)
    • $handler (Net::Jabber::Loudmouth::MessageHandler)
  • message = $connection->send_with_reply_and_block ($message) β€” send it and wait for the reply, blocking style
    • $message (Net::Jabber::Loudmouth::Message)
  • string = $connection->get_server β€” gimme the server
  • $connection->set_server ($server) β€” set the server
    • $server (string)
  • ssl = $connection->get_ssl β€” gimme the SSL
  • $connection->set_ssl ($ssl) β€” set the SSL
    • $ssl (Net::Jabber::Loudmouth::SSL or undef)
  • connectionstate = $connection->get_state β€” what state are we in rn?
  • $connection->unregister_message_handler ($type, $handler) β€” take a handler off the list
    • $type (Net::Jabber::Loudmouth::MessageType)
    • $handler (Net::Jabber::Loudmouth::MessageHandler)

πŸ¦‹ ENUMS AND FLAGS πŸ¦‹

the little vocabulary words she speaks in ✨

🌈 enum Net::Jabber::Loudmouth::ConnectionState

  • 'closed' / LM_CONNECTION_STATE_CLOSED
  • 'opening' / LM_CONNECTION_STATE_OPENING
  • 'open' / LM_CONNECTION_STATE_OPEN
  • 'authenticating' / LM_CONNECTION_STATE_AUTHENTICATING
  • 'authenticated' / LM_CONNECTION_STATE_AUTHENTICATED

🌈 enum Net::Jabber::Loudmouth::HandlerPriority

  • 'last' / LM_HANDLER_PRIORITY_LAST
  • 'normal' / LM_HANDLER_PRIORITY_NORMAL
  • 'first' / LM_HANDLER_PRIORITY_FIRST

🌈 enum Net::Jabber::Loudmouth::MessageType

  • 'message' / LM_MESSAGE_TYPE_MESSAGE
  • 'presence' / LM_MESSAGE_TYPE_PRESENCE
  • 'iq' / LM_MESSAGE_TYPE_IQ
  • 'stream' / LM_MESSAGE_TYPE_STREAM
  • 'stream-error' / LM_MESSAGE_TYPE_STREAM_ERROR
  • 'stream-features' / LM_MESSAGE_TYPE_STREAM_FEATURES
  • 'auth' / LM_MESSAGE_TYPE_AUTH
  • 'challenge' / LM_MESSAGE_TYPE_CHALLENGE
  • 'response' / LM_MESSAGE_TYPE_RESPONSE
  • 'success' / LM_MESSAGE_TYPE_SUCCESS
  • 'failure' / LM_MESSAGE_TYPE_FAILURE
  • 'proceed' / LM_MESSAGE_TYPE_PROCEED
  • 'starttls' / LM_MESSAGE_TYPE_STARTTLS
  • 'unknown' / LM_MESSAGE_TYPE_UNKNOWN

πŸ’– SEE ALSO πŸ’–

go read these too, they're iconic:

  • Net::Jabber::Loudmouth
  • Glib::Boxed

Copyright (C) 2005 by Florian Ragwitz

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.8.7 or, at your option, any later version of Perl 5 you may have available.


and that's the whole page bestie, perl v5.42.3, dated 2026-08-20 🫢 slay, go build something cute πŸ’…βœ¨

πŸ“¦ where this page comes from