WockyPorter

WockyPorter — Wrapper around a WockyXmppConnection providing a higher level API.

Synopsis

enum                WockyPorterError;
GQuark              wocky_porter_error_quark            (void);
#define             WOCKY_PORTER_HANDLER_PRIORITY_MIN
#define             WOCKY_PORTER_HANDLER_PRIORITY_NORMAL
#define             WOCKY_PORTER_HANDLER_PRIORITY_MAX
#define             WOCKY_PORTER_ERROR
                    WockyPorter;
                    WockyPorterClass;
WockyPorter *       wocky_porter_new                    (WockyXmppConnection *connection);
void                wocky_porter_send_async             (WockyPorter *porter,
                                                         WockyXmppStanza *stanza,
                                                         GCancellable *cancellable,
                                                         GAsyncReadyCallback callback,
                                                         gpointer user_data);
gboolean            wocky_porter_send_finish            (WockyPorter *porter,
                                                         GAsyncResult *result,
                                                         GError **error);
void                wocky_porter_send                   (WockyPorter *porter,
                                                         WockyXmppStanza *stanza);
void                wocky_porter_start                  (WockyPorter *porter);
gboolean            (*WockyPorterHandlerFunc)           (WockyPorter *porter,
                                                         WockyXmppStanza *stanza,
                                                         gpointer user_data);
guint               wocky_porter_register_handler       (WockyPorter *porter,
                                                         WockyStanzaType type,
                                                         WockyStanzaSubType sub_type,
                                                         const gchar *from,
                                                         guint priority,
                                                         WockyPorterHandlerFunc callback,
                                                         gpointer user_data,
                                                         WockyBuildTag spec,
                                                         ...);
void                wocky_porter_unregister_handler     (WockyPorter *porter,
                                                         guint id);
void                wocky_porter_close_async            (WockyPorter *porter,
                                                         GCancellable *cancellable,
                                                         GAsyncReadyCallback callback,
                                                         gpointer user_data);
gboolean            wocky_porter_close_finish           (WockyPorter *porter,
                                                         GAsyncResult *result,
                                                         GError **error);
void                wocky_porter_send_iq_async          (WockyPorter *porter,
                                                         WockyXmppStanza *stanza,
                                                         GCancellable *cancellable,
                                                         GAsyncReadyCallback callback,
                                                         gpointer user_data);
WockyXmppStanza *   wocky_porter_send_iq_finish         (WockyPorter *porter,
                                                         GAsyncResult *result,
                                                         GError **error);
void                wocky_porter_force_close_async      (WockyPorter *porter,
                                                         GCancellable *cancellable,
                                                         GAsyncReadyCallback callback,
                                                         gpointer user_data);
gboolean            wocky_porter_force_close_finish     (WockyPorter *porter,
                                                         GAsyncResult *result,
                                                         GError **error);

Object Hierarchy

  GObject
   +----WockyPorter

Properties

  "connection"               WockyXmppConnection*  : Read / Write / Construct Only

Signals

  "closing"                                        : Run Last
  "remote-closed"                                  : Run Last
  "remote-error"                                   : Run Last

Description

Sends and receives WockyXmppStanza from an underlying WockyXmppConnection.

Details

enum WockyPorterError

typedef enum {
  WOCKY_PORTER_ERROR_NOT_STARTED,
  WOCKY_PORTER_ERROR_CLOSING,
  WOCKY_PORTER_ERROR_CLOSED,
  WOCKY_PORTER_ERROR_NOT_IQ,
  WOCKY_PORTER_ERROR_FORCIBLY_CLOSED,
} WockyPorterError;


wocky_porter_error_quark ()

GQuark              wocky_porter_error_quark            (void);

Get the error quark used by the porter.

Returns :

the quark for porter errors.

WOCKY_PORTER_HANDLER_PRIORITY_MIN

#define WOCKY_PORTER_HANDLER_PRIORITY_MIN 0


WOCKY_PORTER_HANDLER_PRIORITY_NORMAL

#define WOCKY_PORTER_HANDLER_PRIORITY_NORMAL (guint) (G_MAXUINT / 2)


WOCKY_PORTER_HANDLER_PRIORITY_MAX

#define WOCKY_PORTER_HANDLER_PRIORITY_MAX G_MAXUINT


WOCKY_PORTER_ERROR

#define WOCKY_PORTER_ERROR (wocky_porter_error_quark ())

Get access to the error quark of the xmpp porter.


WockyPorter

typedef struct _WockyPorter WockyPorter;


WockyPorterClass

typedef struct {
    GObjectClass parent_class;
} WockyPorterClass;


wocky_porter_new ()

WockyPorter *       wocky_porter_new                    (WockyXmppConnection *connection);

Convenience function to create a new WockyPorter.

connection :

WockyXmppConnection which will be used to receive and send WockyXmppStanza

Returns :

a new WockyPorter.

wocky_porter_send_async ()

void                wocky_porter_send_async             (WockyPorter *porter,
                                                         WockyXmppStanza *stanza,
                                                         GCancellable *cancellable,
                                                         GAsyncReadyCallback callback,
                                                         gpointer user_data);

porter :

stanza :

cancellable :

callback :

user_data :


wocky_porter_send_finish ()

gboolean            wocky_porter_send_finish            (WockyPorter *porter,
                                                         GAsyncResult *result,
                                                         GError **error);

porter :

result :

error :

Returns :


wocky_porter_send ()

void                wocky_porter_send                   (WockyPorter *porter,
                                                         WockyXmppStanza *stanza);

porter :

stanza :


wocky_porter_start ()

void                wocky_porter_start                  (WockyPorter *porter);

porter :


WockyPorterHandlerFunc ()

gboolean            (*WockyPorterHandlerFunc)           (WockyPorter *porter,
                                                         WockyXmppStanza *stanza,
                                                         gpointer user_data);

porter :

stanza :

user_data :

Returns :


wocky_porter_register_handler ()

guint               wocky_porter_register_handler       (WockyPorter *porter,
                                                         WockyStanzaType type,
                                                         WockyStanzaSubType sub_type,
                                                         const gchar *from,
                                                         guint priority,
                                                         WockyPorterHandlerFunc callback,
                                                         gpointer user_data,
                                                         WockyBuildTag spec,
                                                         ...);

porter :

type :

sub_type :

from :

priority :

callback :

user_data :

spec :

... :

Returns :


wocky_porter_unregister_handler ()

void                wocky_porter_unregister_handler     (WockyPorter *porter,
                                                         guint id);

porter :

id :


wocky_porter_close_async ()

void                wocky_porter_close_async            (WockyPorter *porter,
                                                         GCancellable *cancellable,
                                                         GAsyncReadyCallback callback,
                                                         gpointer user_data);

porter :

cancellable :

callback :

user_data :


wocky_porter_close_finish ()

gboolean            wocky_porter_close_finish           (WockyPorter *porter,
                                                         GAsyncResult *result,
                                                         GError **error);

porter :

result :

error :

Returns :


wocky_porter_send_iq_async ()

void                wocky_porter_send_iq_async          (WockyPorter *porter,
                                                         WockyXmppStanza *stanza,
                                                         GCancellable *cancellable,
                                                         GAsyncReadyCallback callback,
                                                         gpointer user_data);

porter :

stanza :

cancellable :

callback :

user_data :


wocky_porter_send_iq_finish ()

WockyXmppStanza *   wocky_porter_send_iq_finish         (WockyPorter *porter,
                                                         GAsyncResult *result,
                                                         GError **error);

porter :

result :

error :

Returns :


wocky_porter_force_close_async ()

void                wocky_porter_force_close_async      (WockyPorter *porter,
                                                         GCancellable *cancellable,
                                                         GAsyncReadyCallback callback,
                                                         gpointer user_data);

porter :

cancellable :

callback :

user_data :


wocky_porter_force_close_finish ()

gboolean            wocky_porter_force_close_finish     (WockyPorter *porter,
                                                         GAsyncResult *result,
                                                         GError **error);

porter :

result :

error :

Returns :

Property Details

The "connection" property

  "connection"               WockyXmppConnection*  : Read / Write / Construct Only

the XMPP connection used by this porter.

Signal Details

The "closing" signal

void                user_function                      (WockyPorter *wockyporter,
                                                        gpointer     user_data)        : Run Last

wockyporter :

the object which received the signal.

user_data :

user data set when the signal handler was connected.

The "remote-closed" signal

void                user_function                      (WockyPorter *wockyporter,
                                                        gpointer     user_data)        : Run Last

wockyporter :

the object which received the signal.

user_data :

user data set when the signal handler was connected.

The "remote-error" signal

void                user_function                      (WockyPorter *wockyporter,
                                                        guint        arg1,
                                                        gint         arg2,
                                                        gchar       *arg3,
                                                        gpointer     user_data)        : Run Last

wockyporter :

the object which received the signal.

arg1 :

arg2 :

arg3 :

user_data :

user data set when the signal handler was connected.