Functions the deal with IPC server objects. More...
Functions | |
EAPI Ecore_Ipc_Server * | ecore_ipc_server_add (Ecore_Ipc_Type type, const char *name, int port, const void *data) |
Creates an IPC server that listens for connections. | |
EAPI Ecore_Ipc_Server * | ecore_ipc_server_connect (Ecore_Ipc_Type type, char *name, int port, const void *data) |
Creates an IPC server object to represent the IPC server listening on the given port. | |
EAPI void * | ecore_ipc_server_del (Ecore_Ipc_Server *svr) |
Closes the connection and frees the given IPC server. | |
EAPI void * | ecore_ipc_server_data_get (Ecore_Ipc_Server *svr) |
Retrieves the data associated with the given IPC server. | |
EAPI Eina_Bool | ecore_ipc_server_connected_get (Ecore_Ipc_Server *svr) |
Retrieves whether the given IPC server is currently connected. | |
EAPI Eina_List * | ecore_ipc_server_clients_get (Ecore_Ipc_Server *svr) |
Retrieves the list of clients for this server. | |
EAPI int | ecore_ipc_server_send (Ecore_Ipc_Server *svr, int major, int minor, int ref, int ref_to, int response, const void *data, int size) |
Sends a message to the given IPC server. | |
EAPI void | ecore_ipc_server_client_limit_set (Ecore_Ipc_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 void | ecore_ipc_server_data_size_max_set (Ecore_Ipc_Server *svr, int size) |
Sets the max data payload size for an Ipc message in bytes. | |
EAPI int | ecore_ipc_server_data_size_max_get (Ecore_Ipc_Server *svr) |
Gets the max data payload size for an Ipc message in bytes. | |
EAPI const char * | ecore_ipc_server_ip_get (Ecore_Ipc_Server *svr) |
Gets the IP address of a server that has been connected to. | |
EAPI void | ecore_ipc_server_flush (Ecore_Ipc_Server *svr) |
Flushes all pending data to the given server. | |
Functions the deal with IPC server objects.
EAPI Ecore_Ipc_Server * ecore_ipc_server_add | ( | Ecore_Ipc_Type | type, |
const char * | name, | ||
int | port, | ||
const void * | data | ||
) |
Creates an IPC server that listens for connections.
For more details about the type
, name
and port
parameters, see the ecore_con_server_add documentation.
type | The connection type. |
name | Name to associate with the socket used for connection. |
port | Number to identify with socket used for connection. |
data | Data to associate with the IPC server. |
NULL
is returned. References ecore_con_local_path_new(), eina_error_msg_get(), EINA_FALSE, eina_list_append(), EINA_SAFETY_ON_NULL_GOTO, EINA_SAFETY_ON_NULL_RETURN_VAL, and EINA_TRUE.
EAPI Ecore_Ipc_Server * ecore_ipc_server_connect | ( | Ecore_Ipc_Type | type, |
char * | name, | ||
int | port, | ||
const void * | data | ||
) |
Creates an IPC server object to represent the IPC server listening on the given port.
For more details about the type
, name
and port
parameters, see the ecore_con_server_connect documentation.
type | The IPC connection type. |
name | Name used to determine which socket to use for the IPC connection. |
port | Number used to identify the socket to use for the IPC connection. |
data | Data to associate with the server. |
NULL
is returned on error. References ecore_con_local_path_new(), eina_error_msg_get(), EINA_FALSE, eina_list_append(), EINA_SAFETY_ON_NULL_GOTO, EINA_SAFETY_ON_NULL_RETURN_VAL, and EINA_TRUE.
EAPI void * ecore_ipc_server_del | ( | Ecore_Ipc_Server * | svr | ) |
Closes the connection and frees the given IPC server.
svr | The given IPC server. |
References ecore_ipc_client_del(), eina_list_free(), EINA_LIST_FREE, and eina_list_remove().
Referenced by ecore_ipc_shutdown(), and efreet_cache_disable().
EAPI void * ecore_ipc_server_data_get | ( | Ecore_Ipc_Server * | svr | ) |
Retrieves the data associated with the given IPC server.
svr | The given IPC server. |
EAPI Eina_Bool ecore_ipc_server_connected_get | ( | Ecore_Ipc_Server * | svr | ) |
Retrieves whether the given IPC server is currently connected.
svr | The given IPC server. |
EINA_TRUE
if the server is connected, EINA_FALSE
otherwise. References EINA_FALSE, and EINA_TRUE.
EAPI Eina_List * ecore_ipc_server_clients_get | ( | Ecore_Ipc_Server * | svr | ) |
Retrieves the list of clients for this server.
svr | The given IPC server. |
EAPI int ecore_ipc_server_send | ( | Ecore_Ipc_Server * | svr, |
int | major, | ||
int | minor, | ||
int | ref, | ||
int | ref_to, | ||
int | response, | ||
const void * | data, | ||
int | size | ||
) |
Sends a message to the given IPC server.
The content of the parameters, excluding the svr
parameter, is up to the client.
svr | The given IPC server. |
major | Major opcode of the message. |
minor | Minor opcode of the message. |
ref | Message reference number. |
ref_to | Reference number of the message this message refers to. |
response | Requires response. |
data | The data to send as part of the message. |
size | Length of the data, in bytes, to send. |
0
is returned if there is an error. References eina_error_msg_get(), _Eina_Slice::len, and _Eina_Slice::mem.
EAPI void ecore_ipc_server_client_limit_set | ( | Ecore_Ipc_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.
Beware that if you set this once ecore is already running, you may already have pending CLIENT_ADD events in your event queue. Those clients have already connected and will not be affected by this call. Only clients subsequently trying to connect will be affected.
svr | The given server. |
client_limit | The maximum number of clients to handle concurrently. -1 means unlimited (default). 0 effectively disables the server. |
reject_excess_clients | Set to 1 to automatically disconnect excess clients as soon as they connect if you are already handling client_limit clients. Set to 0 (default) to just hold off on the "accept()" system call until the number of active clients drops. This causes the kernel to queue up to 4096 connections (or your kernel's limit, whichever is lower). |
EAPI void ecore_ipc_server_data_size_max_set | ( | Ecore_Ipc_Server * | svr, |
int | size | ||
) |
Sets the max data payload size for an Ipc message in bytes.
svr | The given server. |
size | The maximum data payload size in bytes. |
EAPI int ecore_ipc_server_data_size_max_get | ( | Ecore_Ipc_Server * | svr | ) |
Gets the max data payload size for an Ipc message in bytes.
svr | The given server. |
EAPI const char * ecore_ipc_server_ip_get | ( | Ecore_Ipc_Server * | svr | ) |
Gets the IP address of a server that has been connected to.
svr | The given server. |
svr
object. If no IP is known NULL is returned. EAPI void ecore_ipc_server_flush | ( | Ecore_Ipc_Server * | svr | ) |
Flushes all pending data to the given server.
Will return when done.
svr | The given server. |
References ecore_main_loop_iterate(), and EINA_TRUE.