Method

PurpleMediaManagersend_application_data

since: 2.6

Declaration [src]

gint
purple_media_manager_send_application_data (
  PurpleMediaManager* manager,
  PurpleMedia* media,
  const gchar* session_id,
  const gchar* participant,
  gpointer buffer,
  guint size,
  gboolean blocking
)

Description [src]

Sends a buffer of data to a #PURPLE_MEDIA_APPLICATION session. If blocking is set, unless an error occurred, the function will not return until the data has been flushed into the network. If the stream is not writable, the data will be queued. It is the responsibility of the user to stop sending data when the stream isn’t writable anymore. It is also the responsibility of the user to only start sending data after the stream has been configured correctly (encryption parameters for example).

Available since: 2.6

Parameters

media

Type: PurpleMedia

The media instance to which the session belongs.

The data is owned by the caller of the function.
session_id

Type: const gchar*

The session to send data to.

The data is owned by the caller of the function.
The value is a NUL terminated UTF-8 string.
participant

Type: const gchar*

The participant to send data to.

The data is owned by the caller of the function.
The value is a NUL terminated UTF-8 string.
buffer

Type: gpointer

The buffer of data to send.

The argument can be NULL.
The data is owned by the caller of the function.
size

Type: guint

The size of buffer.

blocking

Type: gboolean

Whether to block until the data was send or not.

Return value

Type: gint

Number of bytes sent or -1 in case of error.