wocky Reference Manual | ||||
---|---|---|---|---|
Top | Description | Object Hierarchy | Properties |
WockyXmppConnection; WockyXmppConnectionClass; WockyXmppConnectionPrivate; enum WockyXmppConnectionError; GQuark wocky_xmpp_connection_error_quark (void
); #define WOCKY_XMPP_CONNECTION_ERROR WockyXmppConnection * wocky_xmpp_connection_new (GIOStream *stream
); void wocky_xmpp_connection_send_open_async (WockyXmppConnection *connection
,const gchar *to
,const gchar *from
,const gchar *version
,const gchar *lang
,const gchar *id
,GCancellable *cancellable
,GAsyncReadyCallback callback
,gpointer user_data
); gboolean wocky_xmpp_connection_send_open_finish (WockyXmppConnection *connection
,GAsyncResult *result
,GError **error
); void wocky_xmpp_connection_recv_open_async (WockyXmppConnection *connection
,GCancellable *cancellable
,GAsyncReadyCallback callback
,gpointer user_data
); gboolean wocky_xmpp_connection_recv_open_finish (WockyXmppConnection *connection
,GAsyncResult *result
,gchar **to
,gchar **from
,gchar **version
,gchar **lang
,gchar **id
,GError **error
); void wocky_xmpp_connection_send_stanza_async (WockyXmppConnection *connection
,WockyStanza *stanza
,GCancellable *cancellable
,GAsyncReadyCallback callback
,gpointer user_data
); gboolean wocky_xmpp_connection_send_stanza_finish (WockyXmppConnection *connection
,GAsyncResult *result
,GError **error
); void wocky_xmpp_connection_recv_stanza_async (WockyXmppConnection *connection
,GCancellable *cancellable
,GAsyncReadyCallback callback
,gpointer user_data
); WockyStanza * wocky_xmpp_connection_recv_stanza_finish (WockyXmppConnection *connection
,GAsyncResult *result
,GError **error
); void wocky_xmpp_connection_send_close_async (WockyXmppConnection *connection
,GCancellable *cancellable
,GAsyncReadyCallback callback
,gpointer user_data
); gboolean wocky_xmpp_connection_send_close_finish (WockyXmppConnection *connection
,GAsyncResult *result
,GError **error
); void wocky_xmpp_connection_force_close_async (WockyXmppConnection *connection
,GCancellable *cancellable
,GAsyncReadyCallback callback
,gpointer user_data
); gboolean wocky_xmpp_connection_force_close_finish (WockyXmppConnection *connection
,GAsyncResult *result
,GError **error
); void wocky_xmpp_connection_reset (WockyXmppConnection *connection
); gchar * wocky_xmpp_connection_new_id (WockyXmppConnection *self
);
typedef enum { WOCKY_XMPP_CONNECTION_ERROR_EOS, WOCKY_XMPP_CONNECTION_ERROR_CLOSED, WOCKY_XMPP_CONNECTION_ERROR_NOT_OPEN, WOCKY_XMPP_CONNECTION_ERROR_IS_CLOSED, WOCKY_XMPP_CONNECTION_ERROR_IS_OPEN, } WockyXmppConnectionError;
The WockyXmppConnection specific errors that can occur while reading a stream.
Connection got closed before receiving an XMPP stream close. | |
Other side closed the xmpp stream. | |
Trying to send or receive while the connection isn't open. | |
Trying to send or receive while the connection is closed. | |
Trying to send or receive the connection opening when it's already open |
GQuark wocky_xmpp_connection_error_quark (void
);
Get the error quark used by the connection.
Returns : |
the quark for connection errors. |
#define WOCKY_XMPP_CONNECTION_ERROR (wocky_xmpp_connection_error_quark ())
Get access to the error quark of the xmpp connection.
WockyXmppConnection * wocky_xmpp_connection_new (GIOStream *stream
);
Convenience function to create a new WockyXmppConnection.
|
GIOStream over wich all the data will be sent/received. |
Returns : |
a new WockyXmppConnection. |
void wocky_xmpp_connection_send_open_async (WockyXmppConnection *connection
,const gchar *to
,const gchar *from
,const gchar *version
,const gchar *lang
,const gchar *id
,GCancellable *cancellable
,GAsyncReadyCallback callback
,gpointer user_data
);
Request asynchronous sending of an XMPP stream opening over the stream. When
the operation is finished callback
will be called. You can then call
wocky_xmpp_connection_send_open_finish()
to get the result of the operation.
|
a WockyXmppConnection. |
|
destination in the XMPP opening (can be NULL). |
|
sender in the XMPP opening (can be NULL). |
|
XMPP version sent (can be NULL). |
|
language sent (can be NULL). |
|
XMPP Stream ID, if any, or NULL |
|
optional GCancellable object, NULL to ignore. |
|
callback to call when the request is satisfied. |
|
the data to pass to callback function. |
gboolean wocky_xmpp_connection_send_open_finish (WockyXmppConnection *connection
,GAsyncResult *result
,GError **error
);
Finishes sending a stream opening.
|
a WockyXmppConnection. |
|
a GAsyncResult. |
|
a GError location to store the error occuring, or NULL to ignore. |
Returns : |
TRUE if the opening was succesfully sent, FALSE on error. |
void wocky_xmpp_connection_recv_open_async (WockyXmppConnection *connection
,GCancellable *cancellable
,GAsyncReadyCallback callback
,gpointer user_data
);
Request asynchronous receiving of an XMPP stream opening over the stream.
When the operation is finished callback
will be called. You can then call
wocky_xmpp_connection_recv_open_finish()
to get the result of the operation.
|
a WockyXmppConnection. |
|
optional GCancellable object, NULL to ignore. |
|
callback to call when the request is satisfied. |
|
the data to pass to callback function. |
gboolean wocky_xmpp_connection_recv_open_finish (WockyXmppConnection *connection
,GAsyncResult *result
,gchar **to
,gchar **from
,gchar **version
,gchar **lang
,gchar **id
,GError **error
);
Finishes receiving a stream opening.
|
a WockyXmppConnection. |
|
a GAsyncResult. |
|
Optional location to store the to attribute in the XMPP open stanza will be stored (free after usage). |
|
Optional location to store the from attribute in the XMPP open stanza will be stored (free after usage). |
|
Optional location to store the version attribute in the XMPP open stanza will be stored (free after usage). |
|
Optional location to store the lang attribute in the XMPP open stanza will be stored (free after usage). |
|
Optional location to store the Session ID of the XMPP stream (free after usage) |
|
a GError location to store the error occuring, or NULL to ignore. |
Returns : |
TRUE if the opening was succesfully received, FALSE on error. |
void wocky_xmpp_connection_send_stanza_async (WockyXmppConnection *connection
,WockyStanza *stanza
,GCancellable *cancellable
,GAsyncReadyCallback callback
,gpointer user_data
);
Request asynchronous sending of a WockyStanza. When the operation is
finished callback
will be called. You can then call
wocky_xmpp_connection_send_stanza_finish()
to get the result of
the operation.
Can only be called after wocky_xmpp_connection_send_open_async has finished its operation.
|
a WockyXmppConnection |
|
WockyStanza to send. |
|
optional GCancellable object, NULL to ignore. |
|
callback to call when the request is satisfied. |
|
the data to pass to callback function. |
gboolean wocky_xmpp_connection_send_stanza_finish (WockyXmppConnection *connection
,GAsyncResult *result
,GError **error
);
Finishes sending a stanza.
|
a WockyXmppConnection. |
|
a GAsyncResult. |
|
a GError location to store the error occuring, or NULL to ignore. |
Returns : |
TRUE if the stanza was succesfully sent, FALSE on error. |
void wocky_xmpp_connection_recv_stanza_async (WockyXmppConnection *connection
,GCancellable *cancellable
,GAsyncReadyCallback callback
,gpointer user_data
);
Asynchronous receive a WockyStanza. When the operation is
finished callback
will be called. You can then call
wocky_xmpp_connection_recv_stanza_finish()
to get the result of
the operation.
Can only be called after wocky_xmpp_connection_recv_open_async has finished its operation.
|
a WockyXmppConnection |
|
optional GCancellable object, NULL to ignore. |
|
callback to call when the request is satisfied. |
|
the data to pass to callback function. |
WockyStanza * wocky_xmpp_connection_recv_stanza_finish (WockyXmppConnection *connection
,GAsyncResult *result
,GError **error
);
Finishes receiving a stanza
|
a WockyXmppConnection. |
|
a GAsyncResult. |
|
a GError location to store the error occuring, or NULL to ignore. |
Returns : |
A WockyStanza or NULL on error (unref after usage) |
void wocky_xmpp_connection_send_close_async (WockyXmppConnection *connection
,GCancellable *cancellable
,GAsyncReadyCallback callback
,gpointer user_data
);
Request asynchronous sending of an XMPP stream close. When
the operation is finished callback
will be called. You can then call
wocky_xmpp_connection_send_close_finish()
to get the result of the
operation.
Can only be called after wocky_xmpp_connection_send_open_async has finished its operation.
|
a WockyXmppConnection. |
|
optional GCancellable object, NULL to ignore. |
|
callback to call when the request is satisfied. |
|
the data to pass to callback function. |
gboolean wocky_xmpp_connection_send_close_finish (WockyXmppConnection *connection
,GAsyncResult *result
,GError **error
);
Finishes send the xmpp stream close.
|
a WockyXmppConnection. |
|
a GAsyncResult. |
|
a GError location to store the error occuring, or NULL to ignore. |
Returns : |
TRUE on success or FALSE on error. |
void wocky_xmpp_connection_force_close_async (WockyXmppConnection *connection
,GCancellable *cancellable
,GAsyncReadyCallback callback
,gpointer user_data
);
|
|
|
|
|
|
|
gboolean wocky_xmpp_connection_force_close_finish (WockyXmppConnection *connection
,GAsyncResult *result
,GError **error
);
|
|
|
|
|
|
Returns : |
void wocky_xmpp_connection_reset (WockyXmppConnection *connection
);
Reset the XMPP Connection. After the reset the connection is back in its
initial state (as if wocky_xmpp_connection_send_open_async()
and
wocky_xmpp_connection_recv_open_async()
were never called).
|
a WockyXmppConnection. |
gchar * wocky_xmpp_connection_new_id (WockyXmppConnection *self
);
|
|
Returns : |
A short unique string for usage as the id attribute on a stanza (free after usage). |
"base-stream"
property"base-stream" GIOStream* : Read / Write / Construct Only
the stream that the XMPP connection communicates over.