Tizen Native API  5.0
Ecore Connection Client Functions

Functions to communicate with and/or set options on a client.

This set of functions, as explained in Ecore Connection Server Functions, is used to send data to a client, or to set options and get information about this client. Most of them should be used on the server, applied on the client object.

If you need to implement a client, the way to connect to a server is described in Ecore Connection Server Functions.

An example of usage of these functions can be found at:

Functions

int ecore_con_client_send (Ecore_Con_Client *cl, const void *data, int size)
 Sends the given data to the given client.
void * ecore_con_client_del (Ecore_Con_Client *cl)
 Closes the connection and free memory allocated to the given client.
void ecore_con_client_data_set (Ecore_Con_Client *cl, const void *data)
 Sets the data associated with the given client to data.
void * ecore_con_client_data_get (Ecore_Con_Client *cl)
 Retrieves the data associated with the given client.
const char * ecore_con_client_ip_get (const Ecore_Con_Client *cl)
 Gets the IP address of a client that has connected.
void ecore_con_client_flush (Ecore_Con_Client *cl)
 Flushes all pending data to the given client.
double ecore_con_client_uptime_get (const Ecore_Con_Client *cl)
 Checks how long a client has been connected.
double ecore_con_client_timeout_get (const Ecore_Con_Client *cl)
 Gets the default time after which the client will be disconnected when inactive.
void ecore_con_client_timeout_set (Ecore_Con_Client *cl, double timeout)
 Sets the time after which the client will be disconnected when inactive.
Eina_Bool ecore_con_client_connected_get (const Ecore_Con_Client *cl)
 Returns whether the client is still connected.
int ecore_con_client_port_get (const Ecore_Con_Client *cl)
 Returns the port that the client has connected to.
int ecore_ipc_ssl_available_get (void)
 Returns if SSL support is available.

Function Documentation

Eina_Bool ecore_con_client_connected_get ( const Ecore_Con_Client *  cl)

Returns whether the client is still connected.

Parameters:
clThe given client.
Returns:
EINA_TRUE if connected, EINA_FALSE otherwise.
Since :
3.0
Examples:
ecore_con_server_simple_example.c.
void* ecore_con_client_data_get ( Ecore_Con_Client *  cl)

Retrieves the data associated with the given client.

Parameters:
clThe given client.
Returns:
The data associated with cl.
Since :
3.0
Examples:
ecore_con_server_simple_example.c.
void ecore_con_client_data_set ( Ecore_Con_Client *  cl,
const void *  data 
)

Sets the data associated with the given client to data.

Parameters:
clThe given client.
dataWhat to set the data to.
Since :
3.0
Examples:
ecore_con_server_simple_example.c.
void* ecore_con_client_del ( Ecore_Con_Client *  cl)

Closes the connection and free memory allocated to the given client.

Parameters:
clThe given client.
Returns:
Data associated with the client.
Since :
3.0
Examples:
ecore_con_server_simple_example.c.
void ecore_con_client_flush ( Ecore_Con_Client *  cl)

Flushes all pending data to the given client.

Parameters:
clThe given client.

This function will block until all data is sent to the server.

See also:
ecore_con_client_send()
ecore_con_server_flush()
Since :
3.0
Examples:
ecore_con_server_simple_example.c.
const char* ecore_con_client_ip_get ( const Ecore_Con_Client *  cl)

Gets the IP address of a client that has connected.

Parameters:
clThe given client.
Returns:
A pointer to an internal string that contains the IP address of the connected client in the form "XXX.YYY.ZZZ.AAA" IP notation.

The returned string should not be modified, freed or trusted to stay valid after deletion for the cl object. If no IP is known NULL is returned.

Since :
3.0
Examples:
ecore_con_server_simple_example.c.
int ecore_con_client_port_get ( const Ecore_Con_Client *  cl)

Returns the port that the client has connected to.

Parameters:
clThe client
Returns:
The port that cl has connected to, or -1 on error Use this function to return the port on which a given client has connected.
Since :
3.0
Examples:
ecore_con_server_simple_example.c.
int ecore_con_client_send ( Ecore_Con_Client *  cl,
const void *  data,
int  size 
)

Sends the given data to the given client.

Parameters:
clThe given client.
dataThe given data.
sizeLength of the data, in bytes, to send.
Returns:
The number of bytes sent. 0 will be returned if there is an error.

This function will send the given data to the client as soon as the program is back to the main loop. Thus, this function returns immediately (non-blocking). If the data needs to be sent now, call ecore_con_client_flush() after this one.

See also:
ecore_con_server_send()
ecore_con_client_flush()
Since :
3.0
Examples:
ecore_con_server_simple_example.c.
double ecore_con_client_timeout_get ( const Ecore_Con_Client *  cl)

Gets the default time after which the client will be disconnected when inactive.

Parameters:
clThe client object.
Returns:
The timeout, in seconds, to disconnect after.

This function is used to get the idle timeout for a client. A value of < 1 means the idle timeout is disabled.

See also:
ecore_con_client_timeout_set()
Since :
3.0
void ecore_con_client_timeout_set ( Ecore_Con_Client *  cl,
double  timeout 
)

Sets the time after which the client will be disconnected when inactive.

Parameters:
clThe client object
timeoutThe timeout, in seconds, to disconnect after

This function is used by the server to set the idle timeout on a specific client. If the client becomes idle for a time higher than this value, it will be disconnected. A value of < 1 disables the idle timeout.

This timeout is not affected by the one set by ecore_con_server_timeout_set(). A client will be disconnected whenever the client or the server timeout is reached. That means, the lower timeout value will be used for that client if ecore_con_server_timeout_set() is used on the server.

See also:
ecore_con_client_timeout_get()
ecore_con_server_timeout_set()
Since :
3.0
Examples:
ecore_con_server_simple_example.c.
double ecore_con_client_uptime_get ( const Ecore_Con_Client *  cl)

Checks how long a client has been connected.

Parameters:
clThe client to check
Returns:
The total time, in seconds, that the client has been connected to the server

This function is used to find out how long a client has been connected for.

Since :
3.0
Examples:
ecore_con_server_simple_example.c.

Returns if SSL support is available.

Returns:
1 if SSL is available, 0 if it is not.
Since :
3.0