Functions to communicate with and/or set options on a client. More...
Typedefs | |
typedef struct _Ecore_Con_Client | Ecore_Con_Client |
A connection handle to a client. | |
Functions | |
EAPI int | ecore_con_client_send (Ecore_Con_Client *cl, const void *data, int size) |
Sends the given data to the given client. More... | |
EAPI Ecore_Con_Server * | ecore_con_client_server_get (Ecore_Con_Client *cl) |
Retrieves the server representing the socket the client has connected to. More... | |
EAPI Eina_Bool | ecore_con_client_connected_get (Ecore_Con_Client *cl) |
Returns whether the client is still connected. More... | |
EAPI void | ecore_con_client_timeout_set (Ecore_Con_Client *cl, double timeout) |
Set the time after which the client will be disconnected when inactive. More... | |
EAPI double | ecore_con_client_timeout_get (Ecore_Con_Client *cl) |
Get the default time after which the client will be disconnected when inactive. More... | |
EAPI void * | ecore_con_client_del (Ecore_Con_Client *cl) |
Closes the connection and frees memory allocated to the given client. More... | |
EAPI void | ecore_con_client_data_set (Ecore_Con_Client *cl, const void *data) |
Sets the data associated with the given client to data . More... | |
EAPI void * | ecore_con_client_data_get (Ecore_Con_Client *cl) |
Retrieves the data associated with the given client. More... | |
EAPI const char * | ecore_con_client_ip_get (Ecore_Con_Client *cl) |
Gets the IP address of a client that has connected. More... | |
EAPI int | ecore_con_client_port_get (Ecore_Con_Client *cl) |
Return the port that the client has connected to. More... | |
EAPI double | ecore_con_client_uptime_get (Ecore_Con_Client *cl) |
Check how long a client has been connected. More... | |
EAPI void | ecore_con_client_flush (Ecore_Con_Client *cl) |
Flushes all pending data to the given client. More... | |
EAPI int | ecore_con_server_fd_get (Ecore_Con_Server *svr) |
Get the fd that the server is connected to. More... | |
EAPI int | ecore_con_client_fd_get (Ecore_Con_Client *cl) |
Get the fd that the client is connected to. More... | |
int | ecore_con_ssl_available_get (void) |
Returns if SSL support is available. More... | |
EAPI int | ecore_ipc_ssl_available_get (void) |
Returns if SSL support is available. More... | |
Functions to communicate with and/or set options on a client.
Functions that operate on Ecore connection client objects.
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:
EAPI int ecore_con_client_send | ( | Ecore_Con_Client * | cl, |
const void * | data, | ||
int | size | ||
) |
Sends the given data to the given client.
cl | The given client. |
data | The given data. |
size | Length of the data, in bytes, to send. |
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.
References ECORE_CON_REMOTE_CORK, ECORE_CON_REMOTE_UDP, ECORE_FD_READ, ECORE_FD_WRITE, ecore_main_fd_handler_active_set(), eina_binbuf_append_length(), and eina_binbuf_new().
Referenced by ecore_ipc_client_send().
EAPI Ecore_Con_Server * ecore_con_client_server_get | ( | Ecore_Con_Client * | cl | ) |
Retrieves the server representing the socket the client has connected to.
cl | The given client. |
EAPI Eina_Bool ecore_con_client_connected_get | ( | Ecore_Con_Client * | cl | ) |
Returns whether the client is still connected.
cl | The given client. |
EINA_TRUE
if connected, EINA_FALSE
otherwise. References EINA_FALSE.
Referenced by ecore_ipc_client_send().
EAPI void ecore_con_client_timeout_set | ( | Ecore_Con_Client * | cl, |
double | timeout | ||
) |
Set the time after which the client will be disconnected when inactive.
cl | The client object |
timeout | The 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.
EAPI double ecore_con_client_timeout_get | ( | Ecore_Con_Client * | cl | ) |
Get the default time after which the client will be disconnected when inactive.
cl | The client object |
This function is used to get the idle timeout for a client. A value of < 1 means the idle timeout is disabled.
EAPI void * ecore_con_client_del | ( | Ecore_Con_Client * | cl | ) |
Closes the connection and frees memory allocated to the given client.
cl | The given client. |
Referenced by ecore_ipc_client_del().
EAPI void ecore_con_client_data_set | ( | Ecore_Con_Client * | cl, |
const void * | data | ||
) |
Sets the data associated with the given client to data
.
cl | The given client. |
data | What to set the data to. |
EAPI void * ecore_con_client_data_get | ( | Ecore_Con_Client * | cl | ) |
Retrieves the data associated with the given client.
cl | The given client. |
cl
. EAPI const char * ecore_con_client_ip_get | ( | Ecore_Con_Client * | cl | ) |
Gets the IP address of a client that has connected.
cl | The given client. |
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.
Referenced by ecore_ipc_client_ip_get().
EAPI int ecore_con_client_port_get | ( | Ecore_Con_Client * | cl | ) |
Return the port that the client has connected to.
cl | The client |
cl
has connected to, or -1 on error Use this function to return the port on which a given client has connected. EAPI double ecore_con_client_uptime_get | ( | Ecore_Con_Client * | cl | ) |
Check how long a client has been connected.
cl | The client to check |
This function is used to find out how long a client has been connected for.
References ecore_time_get().
EAPI void ecore_con_client_flush | ( | Ecore_Con_Client * | cl | ) |
Flushes all pending data to the given client.
cl | The given client. |
This function will block until all data is sent to the server.
Referenced by ecore_ipc_client_flush().
EAPI int ecore_con_server_fd_get | ( | Ecore_Con_Server * | svr | ) |
Get the fd that the server is connected to.
svr | The server object |
This function returns the fd which is used by the underlying server connection. It should not be tampered with unless you REALLY know what you are doing.
References ecore_main_fd_handler_fd_get().
EAPI int ecore_con_client_fd_get | ( | Ecore_Con_Client * | cl | ) |
Get the fd that the client is connected to.
cl | The client object |
This function returns the fd which is used by the underlying client connection. It should not be tampered with unless you REALLY know what you are doing.
References ecore_main_fd_handler_fd_get().
int ecore_con_ssl_available_get | ( | void | ) |
Returns if SSL support is available.
Referenced by ecore_ipc_ssl_available_get().
EAPI int ecore_ipc_ssl_available_get | ( | void | ) |
Returns if SSL support is available.
References ecore_con_ssl_available_get().