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:
Function Documentation
Returns whether the client is still connected.
- Parameters:
-
- Returns:
EINA_TRUE
if connected, EINA_FALSE
otherwise.
- Since :
- 3.0
- Examples:
- ecore_con_server_simple_example.c.
Sets the data associated with the given client to data
.
- Parameters:
-
cl | The given client. |
data | What to set the data to. |
- Since :
- 3.0
- Examples:
- ecore_con_server_simple_example.c.
Closes the connection and free memory allocated to the given client.
- Parameters:
-
- Returns:
- Data associated with the client.
- Since :
- 3.0
- Examples:
- ecore_con_server_simple_example.c.
Gets the IP address of a client that has connected.
- Parameters:
-
- 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.
Returns the port that the client has connected to.
- Parameters:
-
- 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.
Sends the given data to the given client.
- Parameters:
-
cl | The given client. |
data | The given data. |
size | Length 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.
Gets the default time after which the client will be disconnected when inactive.
- Parameters:
-
- 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
Sets the time after which the client will be disconnected when inactive.
- Parameters:
-
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.
- See also:
- ecore_con_client_timeout_get()
-
ecore_con_server_timeout_set()
- Since :
- 3.0
- Examples:
- ecore_con_server_simple_example.c.
Checks how long a client has been connected.
- Parameters:
-
- 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