Tizen Native API
8.0
|
Functions the deal with IPC server objects.
Functions | |
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. | |
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. | |
void * | ecore_ipc_server_del (Ecore_Ipc_Server *svr) |
Closes the connection and frees the given IPC server. | |
void * | ecore_ipc_server_data_get (Ecore_Ipc_Server *svr) |
Retrieves the data associated with the given IPC server. | |
Eina_Bool | ecore_ipc_server_connected_get (Ecore_Ipc_Server *svr) |
Retrieves whether the given IPC server is currently connected. | |
Eina_List * | ecore_ipc_server_clients_get (Ecore_Ipc_Server *svr) |
Retrieves the list of clients for this server. | |
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. | |
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. | |
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. | |
int | ecore_ipc_server_data_size_max_get (Ecore_Ipc_Server *svr) |
Gets the max data payload size for an Ipc message in bytes. | |
const char * | ecore_ipc_server_ip_get (Ecore_Ipc_Server *svr) |
Gets the IP address of a server that has been connected to. | |
void | ecore_ipc_server_flush (Ecore_Ipc_Server *svr) |
Flushes all pending data to the given server. Will return when done. |
Function Documentation
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.
- Parameters:
-
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.
- Returns:
- New IPC server. If there is an error,
NULL
is returned.
- Since :
- 3.0
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.
- Parameters:
-
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).
- Since :
- 3.0
Retrieves the list of clients for this server.
- Parameters:
-
svr The given IPC server.
- Returns:
- An Eina_List with the clients.
- Since :
- 3.0
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.
- Parameters:
-
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.
- Returns:
- A new IPC server.
NULL
is returned on error.
- Since :
- 3.0
Retrieves whether the given IPC server is currently connected.
- Parameters:
-
svr The given IPC server.
- Returns:
EINA_TRUE
if the server is connected,EINA_FALSE
otherwise.
- Since :
- 3.0
void* ecore_ipc_server_data_get | ( | Ecore_Ipc_Server * | svr | ) |
Retrieves the data associated with the given IPC server.
- Parameters:
-
svr The given IPC server.
- Returns:
- The associated data.
- Since :
- 3.0
int ecore_ipc_server_data_size_max_get | ( | Ecore_Ipc_Server * | svr | ) |
Gets the max data payload size for an Ipc message in bytes.
- Parameters:
-
svr The given server.
- Returns:
- The maximum data payload in bytes.
- Since :
- 3.0
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.
- Parameters:
-
svr The given server. size The maximum data payload size in bytes.
- Since :
- 3.0
void* ecore_ipc_server_del | ( | Ecore_Ipc_Server * | svr | ) |
Closes the connection and frees the given IPC server.
- Parameters:
-
svr The given IPC server.
- Returns:
- The data associated with the server when it was created.
- Since :
- 3.0
void ecore_ipc_server_flush | ( | Ecore_Ipc_Server * | svr | ) |
Flushes all pending data to the given server. Will return when done.
- Parameters:
-
svr The given server.
- Since :
- 3.0
const char* ecore_ipc_server_ip_get | ( | Ecore_Ipc_Server * | svr | ) |
Gets the IP address of a server that has been connected to.
- Parameters:
-
svr The given server.
- Returns:
- A pointer to an internal string that contains the IP address of the connected server in the form "XXX.YYY.ZZZ.AAA" IP notation. This string should not be modified or trusted to stay valid after deletion for the
svr
object. If no IP is known NULL is returned.
- Since :
- 3.0
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.
- Parameters:
-
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.
- Returns:
- Number of bytes sent.
0
is returned if there is an error.
- Since :
- 3.0