summaryrefslogtreecommitdiff
path: root/src/lib/ecore_con
diff options
context:
space:
mode:
authorGustavo Sverzut Barbieri <barbieri@profusion.mobi>2016-12-19 17:19:45 -0200
committerGustavo Sverzut Barbieri <barbieri@profusion.mobi>2016-12-19 17:19:45 -0200
commit42923bc29ebffe7f7b27f35f31d0acea0b56ae99 (patch)
treef45da1b878c9a967583bd15e823aed5bc8b85725 /src/lib/ecore_con
parenta995529a46fe0ceddb28a67fd1d34e0dc456fc66 (diff)
efl_net_server_udp_client: make error easier to understand.
UDP client has no socket on its own, so it can't be marked as close-on-exec, however failing to resolve the method is bad as confuses the user. Instead provide a method that checks if the setting is different from parent, in such case provide a meaningful message. Otherwise just be quiet.
Diffstat (limited to 'src/lib/ecore_con')
-rw-r--r--src/lib/ecore_con/efl_net_server_udp_client.c18
-rw-r--r--src/lib/ecore_con/efl_net_server_udp_client.eo1
2 files changed, 19 insertions, 0 deletions
diff --git a/src/lib/ecore_con/efl_net_server_udp_client.c b/src/lib/ecore_con/efl_net_server_udp_client.c
index db89c3e421..1a4a46ee54 100644
--- a/src/lib/ecore_con/efl_net_server_udp_client.c
+++ b/src/lib/ecore_con/efl_net_server_udp_client.c
@@ -274,6 +274,24 @@ _efl_net_server_udp_client_efl_io_closer_close_on_destructor_get(Eo *o EINA_UNUS
274 return pd->close_on_destructor; 274 return pd->close_on_destructor;
275} 275}
276 276
277EOLIAN static Eina_Bool
278_efl_net_server_udp_client_efl_io_closer_close_on_exec_set(Eo *o, Efl_Net_Server_Udp_Client_Data *pd EINA_UNUSED, Eina_Bool close_on_exec)
279{
280 if (efl_net_server_fd_close_on_exec_get(efl_parent_get(o)) != close_on_exec)
281 {
282 ERR("Efl.Net.Server.Udp.Client close-on-exec must be the same as the server setting, no file descriptor is created for each client!");
283 return EINA_FALSE;
284 }
285
286 return EINA_TRUE;
287}
288
289EOLIAN static Eina_Bool
290_efl_net_server_udp_client_efl_io_closer_close_on_exec_get(Eo *o, Efl_Net_Server_Udp_Client_Data *pd EINA_UNUSED)
291{
292 return efl_net_server_fd_close_on_exec_get(efl_parent_get(o));
293}
294
277EOLIAN static void 295EOLIAN static void
278_efl_net_server_udp_client_efl_net_socket_address_local_set(Eo *o EINA_UNUSED, Efl_Net_Server_Udp_Client_Data *pd, const char *address) 296_efl_net_server_udp_client_efl_net_socket_address_local_set(Eo *o EINA_UNUSED, Efl_Net_Server_Udp_Client_Data *pd, const char *address)
279{ 297{
diff --git a/src/lib/ecore_con/efl_net_server_udp_client.eo b/src/lib/ecore_con/efl_net_server_udp_client.eo
index 77a6fe1c17..9cf3d6f2f9 100644
--- a/src/lib/ecore_con/efl_net_server_udp_client.eo
+++ b/src/lib/ecore_con/efl_net_server_udp_client.eo
@@ -30,6 +30,7 @@ class Efl.Net.Server.Udp.Client (Efl.Object, Efl.Net.Socket) {
30 Efl.Io.Closer.close; 30 Efl.Io.Closer.close;
31 Efl.Io.Closer.closed.get; 31 Efl.Io.Closer.closed.get;
32 Efl.Io.Closer.close_on_destructor; 32 Efl.Io.Closer.close_on_destructor;
33 Efl.Io.Closer.close_on_exec;
33 Efl.Io.Reader.can_read; 34 Efl.Io.Reader.can_read;
34 Efl.Io.Reader.eos; 35 Efl.Io.Reader.eos;
35 Efl.Io.Reader.read; 36 Efl.Io.Reader.read;