EmpathyTpTube

EmpathyTpTube — A wrapper around a Telepathy tube channel

Synopsis


#include <libempathy/empathy-tp-tube.h>

                    EmpathyTpTubeAddress;
                    EmpathyTpTube;
EmpathyTpTube *     empathy_tp_tube_new                 (TpChannel *channel);
EmpathyTpTube *     empathy_tp_tube_new_stream_tube     (EmpathyContact *contact,
                                                         TpSocketAddressType type,
                                                         const gchar *hostname,
                                                         guint port,
                                                         const gchar *service,
                                                         GHashTable *parameters);
void                empathy_tp_tube_accept_stream_tube  (EmpathyTpTube *tube,
                                                         TpSocketAddressType type,
                                                         EmpathyTpTubeAcceptStreamTubeCb *callback,
                                                         gpointer user_data);

Object Hierarchy

  GObject
   +----EmpathyTpTube

Properties

  "channel"                  TpChannel*            : Read / Write / Construct Only
  "state"                    guint                 : Read

Signals

  "destroy"                                        : Run Last

Description

EmpathyTpTube is a convenient object wrapping a Telepathy tube channel.

Details

EmpathyTpTubeAddress

typedef struct {
  TpSocketAddressType type;
  union {
    struct socket_address_t {
      GArray *path;
    } socket;
    struct inet_address_t {
      gchar *hostname;
      guint port;
    } inet;
  } a;
} EmpathyTpTubeAddress;


EmpathyTpTube

typedef struct _EmpathyTpTube EmpathyTpTube;

An object wrapping a Telepathy tube channel.


empathy_tp_tube_new ()

EmpathyTpTube *     empathy_tp_tube_new                 (TpChannel *channel);

Creates a new EmpathyTpTube.

channel :

a TpChannel

Returns :

a new EmpathyTpTube

empathy_tp_tube_new_stream_tube ()

EmpathyTpTube *     empathy_tp_tube_new_stream_tube     (EmpathyContact *contact,
                                                         TpSocketAddressType type,
                                                         const gchar *hostname,
                                                         guint port,
                                                         const gchar *service,
                                                         GHashTable *parameters);

Creates and offers a new EmpathyTpTube of ChannelType StreamTube.

contact :

the EmpathyContact to which the tube is offered

type :

the type of the listening address of the local service. Either TP_SOCKET_ADDRESS_TYPE_IPV4 or TP_SOCKET_ADDRESS_TYPE_IPV6.

hostname :

the address of the local service

port :

the port of the local service

service :

the service name of the tube

parameters :

the parameters of the tube

Returns :

a new EmpathyTpTube

empathy_tp_tube_accept_stream_tube ()

void                empathy_tp_tube_accept_stream_tube  (EmpathyTpTube *tube,
                                                         TpSocketAddressType type,
                                                         EmpathyTpTubeAcceptStreamTubeCb *callback,
                                                         gpointer user_data);

Accepts tube of ChannelType StreamTube and call callback once it's done.

tube :

an EmpathyTpTube

type :

the type of address the connection manager should listen on

callback :

called when the tube has been accepted

user_data :

arbitrary user-supplied data passed to the callback

Property Details

The "channel" property

  "channel"                  TpChannel*            : Read / Write / Construct Only

The TpChannel wrapped by the tube object.


The "state" property

  "state"                    guint                 : Read

The state of the tube.

Allowed values: <= 4

Default value: 0

Signal Details

The "destroy" signal

void                user_function                      (EmpathyTpTube *self,
                                                        gpointer       user_data)      : Run Last

Emitted when then tube has been invalidated.

self :

the tube object

user_data :

user data set when the signal handler was connected.