Strophe
0.8
XMPP client library
|
Functions | |
xmpp_conn_t * | xmpp_conn_new (xmpp_ctx_t *const ctx) |
Create a new Strophe connection object. | |
xmpp_conn_t * | xmpp_conn_clone (xmpp_conn_t *const conn) |
Clone a Strophe connection object. | |
int | xmpp_conn_release (xmpp_conn_t *const conn) |
Release a Strophe connection object. | |
const char * | xmpp_conn_get_jid (const xmpp_conn_t *const conn) |
Get the JID which is or will be bound to the connection. | |
const char * | xmpp_conn_get_bound_jid (const xmpp_conn_t *const conn) |
Get the JID discovered during binding time. | |
void | xmpp_conn_set_jid (xmpp_conn_t *const conn, const char *const jid) |
Set the JID of the user that will be bound to the connection. | |
const char * | xmpp_conn_get_pass (const xmpp_conn_t *const conn) |
Get the password used for authentication of a connection. | |
void | xmpp_conn_set_pass (xmpp_conn_t *const conn, const char *const pass) |
Set the password used to authenticate the connection. | |
xmpp_ctx_t * | xmpp_conn_get_context (xmpp_conn_t *const conn) |
Get the strophe context that the connection is associated with. | |
int | xmpp_connect_client (xmpp_conn_t *const conn, const char *const altdomain, unsigned short altport, xmpp_conn_handler callback, void *const userdata) |
Initiate a connection to the XMPP server. | |
void | xmpp_disconnect (xmpp_conn_t *const conn) |
Initiate termination of the connection to the XMPP server. | |
void | xmpp_send (xmpp_conn_t *const conn, xmpp_stanza_t *const stanza) |
Send an XML stanza to the XMPP server. |
xmpp_conn_t* xmpp_conn_new | ( | xmpp_ctx_t *const | ctx | ) |
Create a new Strophe connection object.
ctx | a Strophe context object |
xmpp_conn_t* xmpp_conn_clone | ( | xmpp_conn_t *const | conn | ) |
Clone a Strophe connection object.
conn | a Strophe connection object |
int xmpp_conn_release | ( | xmpp_conn_t *const | conn | ) |
Release a Strophe connection object.
Decrement the reference count by one for a connection, freeing the connection object if the count reaches 0.
conn | a Strophe connection object |
const char* xmpp_conn_get_jid | ( | const xmpp_conn_t *const | conn | ) |
Get the JID which is or will be bound to the connection.
conn | a Strophe connection object |
const char* xmpp_conn_get_bound_jid | ( | const xmpp_conn_t *const | conn | ) |
Get the JID discovered during binding time.
This JID will contain the resource used by the current connection. This is useful in the case where a resource was not specified for binding.
conn | a Strophe connection object. |
void xmpp_conn_set_jid | ( | xmpp_conn_t *const | conn, |
const char *const | jid | ||
) |
Set the JID of the user that will be bound to the connection.
If any JID was previously set, it will be discarded. This should not be be used after a connection is created. The function will make a copy of the JID string. If the supllied JID is missing the node, SASL ANONYMOUS authentication will be used.
conn | a Strophe connection object |
jid | a full or bare JID |
const char* xmpp_conn_get_pass | ( | const xmpp_conn_t *const | conn | ) |
Get the password used for authentication of a connection.
conn | a Strophe connection object |
void xmpp_conn_set_pass | ( | xmpp_conn_t *const | conn, |
const char *const | pass | ||
) |
Set the password used to authenticate the connection.
If any password was previously set, it will be discarded. The function will make a copy of the password string.
conn | a Strophe connection object |
pass | the password |
xmpp_ctx_t* xmpp_conn_get_context | ( | xmpp_conn_t *const | conn | ) |
Get the strophe context that the connection is associated with.
conn | a Strophe connection object |
int xmpp_connect_client | ( | xmpp_conn_t *const | conn, |
const char *const | altdomain, | ||
unsigned short | altport, | ||
xmpp_conn_handler | callback, | ||
void *const | userdata | ||
) |
Initiate a connection to the XMPP server.
This function returns immediately after starting the connection process to the XMPP server, and notifiations of connection state changes will be sent to the callback function. The domain and port to connect to are usually determined by an SRV lookup for the xmpp-client service at the domain specified in the JID. If SRV lookup fails, altdomain and altport will be used instead if specified.
conn | a Strophe connection object |
altdomain | a string with domain to use if SRV lookup fails. If this is NULL, the domain from the JID will be used. |
altport | an integer port number to use if SRV lookup fails. If this is 0, the default port (5222) will be assumed. |
callback | a xmpp_conn_handler callback function that will receive notifications of connection status |
userdata | an opaque data pointer that will be passed to the callback |
void xmpp_disconnect | ( | xmpp_conn_t *const | conn | ) |
void xmpp_send | ( | xmpp_conn_t *const | conn, |
xmpp_stanza_t *const | stanza | ||
) |