Download

Support

Ecore_Con.h File Reference

Sockets functions. More...


Typedefs

typedef struct _Ecore_Con_Server Ecore_Con_Server
 A connection handle.
typedef struct _Ecore_Con_Client Ecore_Con_Client
 A connection handle.

Functions

EAPI int ecore_con_init (void)
 Initialises the Ecore_Con library.
EAPI int ecore_con_shutdown (void)
 Shuts down the Ecore_Con library.
EAPI Ecore_Con_Serverecore_con_server_add (Ecore_Con_Type type, const char *name, int port, const void *data)
 Creates a server to listen for connections.
EAPI Ecore_Con_Serverecore_con_server_connect (Ecore_Con_Type type, const char *name, int port, const void *data)
 Creates a server object to represent the server listening at the given port.
EAPI void * ecore_con_server_del (Ecore_Con_Server *svr)
 Closes the connection and frees the given server.
EAPI void * ecore_con_server_data_get (Ecore_Con_Server *svr)
 Retrieves the data associated with the given server.
EAPI int ecore_con_server_connected_get (Ecore_Con_Server *svr)
 Retrieves whether the given server is currently connected.
EAPI Ecore_List * ecore_con_server_clients_get (Ecore_Con_Server *svr)
 Retrieves the current list of clients.
EAPI int ecore_con_server_send (Ecore_Con_Server *svr, const void *data, int size)
 Sends the given data to the given server.
EAPI void ecore_con_server_client_limit_set (Ecore_Con_Server *svr, int client_limit, char reject_excess_clients)
 Sets a limit on the number of clients that can be handled concurrently by the given server, and a policy on what to do if excess clients try to connect.
EAPI char * ecore_con_server_ip_get (Ecore_Con_Server *svr)
 Gets the IP address of a server that has been connected to.
EAPI void ecore_con_server_flush (Ecore_Con_Server *svr)
 Flushes all pending data to the given server.
EAPI int ecore_con_client_send (Ecore_Con_Client *cl, const void *data, int size)
 Sends the given data to the given client.
EAPI Ecore_Con_Serverecore_con_client_server_get (Ecore_Con_Client *cl)
 Retrieves the server representing the socket the client has connected to.
EAPI void * ecore_con_client_del (Ecore_Con_Client *cl)
 Closes the connection and frees memory allocated to the given client.
EAPI void ecore_con_client_data_set (Ecore_Con_Client *cl, const void *data)
 Sets the data associated with the given client to data.
EAPI void * ecore_con_client_data_get (Ecore_Con_Client *cl)
 Retrieves the data associated with the given client.
EAPI char * ecore_con_client_ip_get (Ecore_Con_Client *cl)
 Gets the IP address of a cleint that has connected.
EAPI void ecore_con_client_flush (Ecore_Con_Client *cl)
 Flushes all pending data to the given client.
EAPI int ecore_con_ssl_available_get (void)
 Returns if SSL support is available.

Detailed Description

Sockets functions.

The Ecore Connection Library ( Ecore_Con ) provides simple mechanisms for communications between programs using reliable sockets. It saves the programmer from having to worry about file descripters and waiting for incoming connections.

There are two main objects in the Ecore_Con library: the Ecore_Con_Server and the Ecore_Con_Client.

The Ecore_Con_Server represents a server that can be connected to. It is used regardless of whether the program is acting as a server or client itself.

To create a listening server, call ecore_con_server_add().

To connect to a server, call ecore_con_server_connect(). Data can then be sent to the server using the ecore_con_server_send().

Whenever a client connection is made to an Ecore_Con_Server, a ECORE_CON_CLIENT_ADD event is emitted. Any event callbacks that are called receive a Ecore_Con_Client object, which represents a connection that that particular client.

Functions are described in the following groupings:


Copyright © Enlightenment.org

Ecore Documentation