Eet connection functions

Macros | Typedefs | Functions
Eet connection functions
Ecore » Ecore_Con - Connection functions

The Ecore Connection Eet library (`Ecore_Con_Eet`) adds `Eet` data serialization features to Ecore Connection objects. More...

## Typedefs
typedef Eo | Ecore_Con_Eet
typedef struct _Ecore_Con_Reply | Ecore_Con_Reply
typedef void(* | Ecore_Con_Eet_Data_Cb) (void *data, Ecore_Con_Reply *reply, const char *protocol_name, void *value)
| Called when an Ecore_Con_Eet object receives data.
typedef void(* | Ecore_Con_Eet_Raw_Data_Cb) (void *data, Ecore_Con_Reply *reply, const char *protocol_name, const char *section, void *value, size_t length)
| Called when an Ecore_Con_Eet object receives raw data.
typedef Eina_Bool(* | Ecore_Con_Eet_Client_Cb) (void *data, Ecore_Con_Reply *reply, Ecore_Con_Client *conn)
| Called when a client connects to the server.
typedef Eina_Bool(* | Ecore_Con_Eet_Server_Cb) (void *data, Ecore_Con_Reply *reply, Ecore_Con_Server *conn)
| Called when the server has accepted the connection of the client.

## Functions
ECORE_CON_API Ecore_Con_Eet * | ecore_con_eet_server_new (Ecore_Con_Server *server)
| Creates an Ecore_Con_Eet server. More...
ECORE_CON_API Ecore_Con_Eet * | ecore_con_eet_client_new (Ecore_Con_Server *server)
| Creates an Ecore_Con_Eet client. More...
ECORE_CON_API void | ecore_con_eet_server_free (Ecore_Con_Eet *server)
| Frees an existing Ecore_Con_Eet object. More...
ECORE_CON_API void | ecore_con_eet_register (Ecore_Con_Eet *ece, const char *name, Eet_Data_Descriptor *edd)
| Registers an `Eet` data descriptor on a Ecore_Con_Eet object. More...
ECORE_CON_API void | ecore_con_eet_data_callback_add (Ecore_Con_Eet *ece, const char *name, Ecore_Con_Eet_Data_Cb func, const void *data)
| Registers a data callback on a Ecore_Con_Eet object. More...
ECORE_CON_API void | ecore_con_eet_data_callback_del (Ecore_Con_Eet *ece, const char *name)
| Removes a data callback on a Ecore_Con_Eet object. More...
ECORE_CON_API void | ecore_con_eet_raw_data_callback_add (Ecore_Con_Eet *ece, const char *name, Ecore_Con_Eet_Raw_Data_Cb func, const void *data)
| Registers a raw data callback on a Ecore_Con_Eet object. More...
ECORE_CON_API void | ecore_con_eet_raw_data_callback_del (Ecore_Con_Eet *ece, const char *name)
| Removes a raw data callback on a Ecore_Con_Eet object. More...
ECORE_CON_API void | ecore_con_eet_client_connect_callback_add (Ecore_Con_Eet *ece, Ecore_Con_Eet_Client_Cb func, const void *data)
| Registers a client connect callback on a Ecore_Con_Eet object. More...
ECORE_CON_API void | ecore_con_eet_client_connect_callback_del (Ecore_Con_Eet *ece, Ecore_Con_Eet_Client_Cb func, const void *data)
| Removes a client connect callback on a Ecore_Con_Eet object. More...
ECORE_CON_API void | ecore_con_eet_client_disconnect_callback_add (Ecore_Con_Eet *ece, Ecore_Con_Eet_Client_Cb func, const void *data)
| Registers a client disconnect callback on a Ecore_Con_Eet object. More...
ECORE_CON_API void | ecore_con_eet_client_disconnect_callback_del (Ecore_Con_Eet *ece, Ecore_Con_Eet_Client_Cb func, const void *data)
| Removes a client disconnect callback on a Ecore_Con_Eet object. More...
ECORE_CON_API void | ecore_con_eet_server_connect_callback_add (Ecore_Con_Eet *ece, Ecore_Con_Eet_Server_Cb func, const void *data)
| Registers a server connect callback on a Ecore_Con_Eet object. More...
ECORE_CON_API void | ecore_con_eet_server_connect_callback_del (Ecore_Con_Eet *ece, Ecore_Con_Eet_Server_Cb func, const void *data)
| Removes a server connect callback on a Ecore_Con_Eet object. More...
ECORE_CON_API void | ecore_con_eet_server_disconnect_callback_add (Ecore_Con_Eet *ece, Ecore_Con_Eet_Server_Cb func, const void *data)
| Registers a server disconnect callback on a Ecore_Con_Eet object. More...
ECORE_CON_API void | ecore_con_eet_server_disconnect_callback_del (Ecore_Con_Eet *ece, Ecore_Con_Eet_Server_Cb func, const void *data)
| Removes a server disconnect callback on a Ecore_Con_Eet object. More...
ECORE_CON_API void | ecore_con_eet_data_set (Ecore_Con_Eet *ece, const void *data)
| Attaches data to an Ecore_Con_Eet object. More...
ECORE_CON_API const void * | ecore_con_eet_data_get (Ecore_Con_Eet *ece)
| Gets the data attached to an Ecore_Con_Eet object. More...
ECORE_CON_API Ecore_Con_Eet * | ecore_con_eet_reply (Ecore_Con_Reply *reply)
| Gets the Ecore_Con_Eet object corresponding to the Ecore_Con_Reply object. More...
ECORE_CON_API void | ecore_con_eet_send (Ecore_Con_Reply *reply, const char *protocol_name, void *value)
| Sends some data using a protocol type. More...
ECORE_CON_API void | ecore_con_eet_raw_send (Ecore_Con_Reply *reply, const char *protocol_name, const char *section, void *value, unsigned int length)
| Sends some raw data using a protocol type. More...

## Detailed Description

The Ecore Connection Eet library (`Ecore_Con_Eet`) adds `Eet` data serialization features to Ecore Connection objects.

Its main aim is to provide a way to send `Eet` data streams to another program through sockets using `Ecore_Con` objects.

## Function Documentation

## ◆ ecore_con_eet_server_new()

ECORE_CON_API Ecore_Con_Eet* ecore_con_eet_server_new | ( | Ecore_Con_Server * | server | ) |

Creates an Ecore_Con_Eet server.

Parameters

  server | An existing Ecore_Con_Server that have been previously created by the server program with ecore_con_server_add.

This object gets deleted automatically when the parent Ecore_Con_Server is deleted.

Returns
  A new Ecore_Con_Eet server.

## ◆ ecore_con_eet_client_new()

ECORE_CON_API Ecore_Con_Eet* ecore_con_eet_client_new | ( | Ecore_Con_Server * | server | ) |

Creates an Ecore_Con_Eet client.

Parameters

  server | An existing Ecore_Con_Server that have been previously returned by a call to ecore_con_server_connect in the client program.

This object gets deleted automatically when the parent Ecore_Con_Server is deleted.

Returns
  A new Ecore_Con_Eet client.

## ◆ ecore_con_eet_server_free()

ECORE_CON_API void ecore_con_eet_server_free | ( | Ecore_Con_Eet * | server | ) |

Frees an existing Ecore_Con_Eet object.

Parameters

  server | An existing Ecore_Con_Eet object that have been previously allocated by a ecore_con_eet_server_new or ecore_con_eet_client_new.

## ◆ ecore_con_eet_register()

ECORE_CON_API void ecore_con_eet_register | ( | Ecore_Con_Eet * | ece,
|  | const char * | name,
|  | Eet_Data_Descriptor * | edd
| ) |  |

Registers an `Eet` data descriptor on a Ecore_Con_Eet object.

Parameters

  ece | An Ecore_Con_Eet object.
  name | The name of the Eet stream to connect.
  edd | A Eet data descriptor that describes the data organization in the Eet stream.

## ◆ ecore_con_eet_data_callback_add()

ECORE_CON_API void ecore_con_eet_data_callback_add | ( | Ecore_Con_Eet * | ece,
|  | const char * | name,
|  | Ecore_Con_Eet_Data_Cb | func,
|  | const void * | data
| ) |  |

Registers a data callback on a Ecore_Con_Eet object.

When the Ecore_Con_Eet object is deleted, this automatically gets removed.

Parameters

  ece | An Ecore_Con_Eet object.
  name | The name of the Eet stream to connect.
  func | The function to call as a callback.
  data | The data to pass to the callback.

## ◆ ecore_con_eet_data_callback_del()

ECORE_CON_API void ecore_con_eet_data_callback_del | ( | Ecore_Con_Eet * | ece,
|  | const char * | name
| ) |  |

Removes a data callback on a Ecore_Con_Eet object.

Parameters

  ece | An Ecore_Con_Eet object.
  name | The name of the Eet stream to remove callback on.

## ◆ ecore_con_eet_raw_data_callback_add()

ECORE_CON_API void ecore_con_eet_raw_data_callback_add | ( | Ecore_Con_Eet * | ece,
|  | const char * | name,
|  | Ecore_Con_Eet_Raw_Data_Cb | func,
|  | const void * | data
| ) |  |

Registers a raw data callback on a Ecore_Con_Eet object.

When the Ecore_Con_Eet object is deleted, this automatically gets removed.

Parameters

  ece | An Ecore_Con_Eet object.
  name | The name of the raw Eet stream to connect.
  func | The function to call as a callback.
  data | The data to pass to the callback.

## ◆ ecore_con_eet_raw_data_callback_del()

ECORE_CON_API void ecore_con_eet_raw_data_callback_del | ( | Ecore_Con_Eet * | ece,
|  | const char * | name
| ) |  |

Removes a raw data callback on a Ecore_Con_Eet object.

Parameters

  ece | An Ecore_Con_Eet object.
  name | The name of the raw Eet stream to remove callback on.

## ◆ ecore_con_eet_client_connect_callback_add()

ECORE_CON_API void ecore_con_eet_client_connect_callback_add | ( | Ecore_Con_Eet * | ece,
|  | Ecore_Con_Eet_Client_Cb | func,
|  | const void * | data
| ) |  |

Registers a client connect callback on a Ecore_Con_Eet object.

This callback can be registered on the server program to know when a client connects. When the Ecore_Con_Eet object is deleted, this automatically gets removed.

Parameters

  ece | An Ecore_Con_Eet object.
  func | The function to call as a callback.
  data | The data to pass to the callback.

References eina_list_append().

## ◆ ecore_con_eet_client_connect_callback_del()

ECORE_CON_API void ecore_con_eet_client_connect_callback_del | ( | Ecore_Con_Eet * | ece,
|  | Ecore_Con_Eet_Client_Cb | func,
|  | const void * | data
| ) |  |

Removes a client connect callback on a Ecore_Con_Eet object.

Parameters

  ece | An Ecore_Con_Eet object.
  func | The callback to remove.
  data | The data passed to this function at the callback registration.

References EINA_LIST_FOREACH, and eina_list_remove_list().

## ◆ ecore_con_eet_client_disconnect_callback_add()

ECORE_CON_API void ecore_con_eet_client_disconnect_callback_add | ( | Ecore_Con_Eet * | ece,
|  | Ecore_Con_Eet_Client_Cb | func,
|  | const void * | data
| ) |  |

Registers a client disconnect callback on a Ecore_Con_Eet object.

This callback can be registered on the server program to know when a client disconnects. When the Ecore_Con_Eet object is deleted, this automatically gets removed.

Parameters

  ece | An Ecore_Con_Eet object.
  func | The function to call as a callback.
  data | The data to pass to the callback.

References eina_list_append().

## ◆ ecore_con_eet_client_disconnect_callback_del()

ECORE_CON_API void ecore_con_eet_client_disconnect_callback_del | ( | Ecore_Con_Eet * | ece,
|  | Ecore_Con_Eet_Client_Cb | func,
|  | const void * | data
| ) |  |

Removes a client disconnect callback on a Ecore_Con_Eet object.

Parameters

  ece | An Ecore_Con_Eet object.
  func | The callback to remove.
  data | The data passed to this function at the callback registration.

References EINA_LIST_FOREACH, and eina_list_remove_list().

## ◆ ecore_con_eet_server_connect_callback_add()

ECORE_CON_API void ecore_con_eet_server_connect_callback_add | ( | Ecore_Con_Eet * | ece,
|  | Ecore_Con_Eet_Server_Cb | func,
|  | const void * | data
| ) |  |

Registers a server connect callback on a Ecore_Con_Eet object.

This callback can be registered on the client program to be called. when it has been connected to the server. When the Ecore_Con_Eet object is deleted, this automatically gets removed.

Parameters

  ece | An Ecore_Con_Eet object.
  func | The function to call as a callback.
  data | The data to pass to the callback.

References eina_list_append().

## ◆ ecore_con_eet_server_connect_callback_del()

ECORE_CON_API void ecore_con_eet_server_connect_callback_del | ( | Ecore_Con_Eet * | ece,
|  | Ecore_Con_Eet_Server_Cb | func,
|  | const void * | data
| ) |  |

Removes a server connect callback on a Ecore_Con_Eet object.

Parameters

  ece | An Ecore_Con_Eet object.
  func | The callback to remove.
  data | The data passed to this function at the callback registration.

References EINA_LIST_FOREACH, and eina_list_remove_list().

## ◆ ecore_con_eet_server_disconnect_callback_add()

ECORE_CON_API void ecore_con_eet_server_disconnect_callback_add | ( | Ecore_Con_Eet * | ece,
|  | Ecore_Con_Eet_Server_Cb | func,
|  | const void * | data
| ) |  |

Registers a server disconnect callback on a Ecore_Con_Eet object.

This callback can be registered on the client program to be called when it has been disconnected from the server. When the Ecore_Con_Eet object is deleted, this automatically gets removed.

Parameters

  ece | An Ecore_Con_Eet object.
  func | The function to call as a callback.
  data | The data to pass to the callback.

References eina_list_append().

## ◆ ecore_con_eet_server_disconnect_callback_del()

ECORE_CON_API void ecore_con_eet_server_disconnect_callback_del | ( | Ecore_Con_Eet * | ece,
|  | Ecore_Con_Eet_Server_Cb | func,
|  | const void * | data
| ) |  |

Removes a server disconnect callback on a Ecore_Con_Eet object.

Parameters

  ece | An Ecore_Con_Eet object.
  func | The callback to remove.
  data | The data passed to this function at the callback registration.

References EINA_LIST_FOREACH, and eina_list_remove_list().

## ◆ ecore_con_eet_data_set()

ECORE_CON_API void ecore_con_eet_data_set | ( | Ecore_Con_Eet * | ece,
|  | const void * | data
| ) |  |

Attaches data to an Ecore_Con_Eet object.

Parameters

  ece | An Ecore_Con_Eet object.
  data | The data to attach to the Ecore_Con_Eet object.

## ◆ ecore_con_eet_data_get()

ECORE_CON_API const void* ecore_con_eet_data_get | ( | Ecore_Con_Eet * | ece | ) |

Gets the data attached to an Ecore_Con_Eet object.

Parameters

  ece | An Ecore_Con_Eet object.

Returns
  The data attached to the Ecore_Con_Eet object.

## ◆ ecore_con_eet_reply()

ECORE_CON_API Ecore_Con_Eet* ecore_con_eet_reply | ( | Ecore_Con_Reply * | reply | ) |

Gets the Ecore_Con_Eet object corresponding to the Ecore_Con_Reply object.

Parameters

  reply | An Ecore_Con_Reply object.

Returns
  The corresponding Ecore_Con_Eet object.

## ◆ ecore_con_eet_send()

ECORE_CON_API void ecore_con_eet_send | ( | Ecore_Con_Reply * | reply,
|  | const char * | protocol_name,
|  | void * | value
| ) |  |

Sends some data using a protocol type.

Parameters

  reply | An Ecore_Con_Reply object.
  protocol_name | The protocol type to use.
  value | The data to send.

## ◆ ecore_con_eet_raw_send()

ECORE_CON_API void ecore_con_eet_raw_send | ( | Ecore_Con_Reply * | reply,
|  | const char * | protocol_name,
|  | const char * | section,
|  | void * | value,
|  | unsigned int | length
| ) |  |

Sends some raw data using a protocol type.

Parameters

  reply | An Ecore_Con_Reply object.
  protocol_name | The protocol type to use.
  section | The section to add to the protocol.
  value | The data to send.
  length | The data length.

References eina_binbuf_free(), and eina_binbuf_manage_new().