Tizen Native API  5.0
IPC Server Functions

Functions the deal with IPC server objects.

Functions

Ecore_Ipc_Serverecore_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_Serverecore_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_Listecore_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:
typeThe connection type.
nameName to associate with the socket used for connection.
portNumber to identify with socket used for connection.
dataData 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:
svrThe given server.
client_limitThe maximum number of clients to handle concurrently. -1 means unlimited (default). 0 effectively disables the server.
reject_excess_clientsSet 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:
svrThe 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:
typeThe IPC connection type.
nameName used to determine which socket to use for the IPC connection.
portNumber used to identify the socket to use for the IPC connection.
dataData 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:
svrThe given IPC server.
Returns:
EINA_TRUE if the server is connected, EINA_FALSE otherwise.
Since :
3.0

Retrieves the data associated with the given IPC server.

Parameters:
svrThe given IPC server.
Returns:
The associated data.
Since :
3.0

Gets the max data payload size for an Ipc message in bytes.

Parameters:
svrThe 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:
svrThe given server.
sizeThe maximum data payload size in bytes.
Since :
3.0

Closes the connection and frees the given IPC server.

Parameters:
svrThe given IPC server.
Returns:
The data associated with the server when it was created.
Since :
3.0

Flushes all pending data to the given server. Will return when done.

Parameters:
svrThe 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:
svrThe 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:
svrThe given IPC server.
majorMajor opcode of the message.
minorMinor opcode of the message.
refMessage reference number.
ref_toReference number of the message this message refers to.
responseRequires response.
dataThe data to send as part of the message.
sizeLength of the data, in bytes, to send.
Returns:
Number of bytes sent. 0 is returned if there is an error.
Since :
3.0