Method

PurpleMediaManagersend_application_data

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).

Parameters

media PurpleMedia
 

The media instance to which the session belongs.

 The data is owned by the caller of the function.
session_id 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 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 gpointer
 

The buffer of data to send.

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

The size of buffer.

blocking gboolean
 

Whether to block until the data was send or not.

Return value

Returns: gint
 

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