| Top |
WockyPorter * wocky_meta_porter_new (const gchar *jid,WockyContactFactory *contact_factory);
Convenience function to create a new WockyMetaPorter object. The
JID can be set later by using wocky_meta_porter_set_jid().
guint16
wocky_meta_porter_get_port (WockyMetaPorter *porter);
Returns the port porter
is listening in on for new incoming XMPP
connections, or 0 if it has not been started yet with
wocky_porter_start().
void wocky_meta_porter_hold (WockyMetaPorter *porter,WockyContact *contact);
Increases the hold count of the porter to contact
by
one. This means that if there is a connection open to contact
then
it will not disconnected after a timeout. Note that calling this
function does not mean a connection will be opened. The hold
count on a contact survives across connections.
To decrement the hold count of the porter to contact
, one
must call wocky_meta_porter_unhold().
void wocky_meta_porter_unhold (WockyMetaPorter *porter,WockyContact *contact);
Decreases the hold count of the porter to contact
by
one. This means that if there is a connection open to contact
and
the hold count is zero, a connection timeout will be
started.
void wocky_meta_porter_set_jid (WockyMetaPorter *porter,const gchar *jid);
Changes the local JID according to porter
. Note that this function
can only be called once, and only if NULL was passed to
wocky_meta_porter_new() when creating porter
. Calling it again
will be a no-op.
void wocky_meta_porter_open_async (WockyMetaPorter *porter,WockyLLContact *contact,GCancellable *cancellable,GAsyncReadyCallback callback,gpointer user_data);
Make an asynchronous request to open a connection to contact
if
one is not already open. The hold count of the porter to
contact
will be incrememented and so after completion
wocky_meta_porter_unhold() should be called on contact to release
the hold.
When the request is complete, callback
will be called and the user
should call wocky_meta_porter_open_finish() to finish the request.
porter |
||
contact |
the WockyLLContact |
|
cancellable |
an optional GCancellable, or |
|
callback |
a callback to be called |
|
user_data |
data for |
gboolean wocky_meta_porter_open_finish (WockyMetaPorter *porter,GAsyncResult *result,GError **error);
Finishes an asynchronous request to open a connection if one is not
already open. See wocky_meta_porter_open_async() for more details.
porter |
||
result |
the GAsyncResult |
|
error |
an optional GError location to store an error message |
GSocketConnection * wocky_meta_porter_borrow_connection (WockyMetaPorter *porter,WockyLLContact *contact);
Borrow the GSocketConnection of the porter to contact
, if one
exists, otherwise NULL will be returned.
Note that the connection returned should be reffed using
g_object_ref() if it needs to be kept. However, it will still be
operated on by the underlying WockyXmppConnection object so can
close spontaneously unless wocky_meta_porter_hold() is called with
contact
.
“contact-factory” property“contact-factory” WockyContactFactory *
The WockyContactFactory object in use by this meta porter.
Flags: Read / Write / Construct Only