Commit Graph

20 Commits

Author SHA1 Message Date
Vincent Torri f7c560c311 replace hton and ntoh family functions with ones defined in eina
Summary: This fixes especially the execution of edje_cc on Windows

Test Plan: execution of edje_cc

Reviewers: cedric, raster

Subscribers: #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D7834
2019-02-01 14:25:35 +00:00
Cedric BAIL 33c00de365 eo: make efl_future_then have a data pointer in addition of the object pointer.
Summary:
In the case when you have multiple future in flight related to one object, you
couldn't use the previous version of efl_future_then. Now all function calls
take a void* pointer that allow multiple future to have their private data
request data accessible in all the callback.

This should not break released API as Eo.h is not released yet and so
was efl_future_Eina_FutureXXX_then.

Depends on D7332

Reviewers: felipealmeida, segfaultxavi, vitor.sousa, SanghyeonLee, bu5hm4n

Reviewed By: segfaultxavi

Subscribers: #reviewers, #committers

Tags: #efl

Maniphest Tasks: T7472

Differential Revision: https://phab.enlightenment.org/D7379
2018-12-07 12:23:11 +01:00
Cedric BAIL 5de51f84fb eo: rename efl_future_Eina_FutureXXX_then in efl_future_then as this has been available for some time.
Reviewed-by: Vitor Sousa da Silva <vitorsousa@expertisesolutions.com.br>
Differential Revision: https://phab.enlightenment.org/D7327
2018-11-23 11:39:43 -08:00
Cedric BAIL 33fd77e9e4 ecore: move close_on_destructor to close_on_invalidate as that describe the behavior best.
Fix all use to correctly behave on invalidate.
2018-05-01 10:39:01 -07:00
Daniel Kolesa fcae7cab27 eolian gen: enable constness generation on property getter impls
This changes a lot of things all across the EFL. Previously,
methods tagged @const had both their external prototype and
internal impl generated with const on object, while property
getters only had const on the external API. This is now changed
and it all has const everywhere.

Ref T6859.
2018-04-17 20:31:55 +02:00
Hermet Park 32bbf68f08 ecore_con: resolve the possible read of uninitialized data.
Signed-Off-By: JongMin Lee<jm105.lee@samsung.com>
2018-04-05 15:20:14 +09:00
Cedric Bail 25747d0881 ecore: rename efl_loop_Eina_FutureXXX_timeout to efl_loop_timeout. 2017-12-03 16:30:53 -08:00
Vincent Torri 0cdd501246 EFL For WIN32: Replace HAVE_EVIL define with _WIN32 2017-09-22 05:06:10 -05:00
Guilherme Iscaro ec27ceac27 efl_net: Use the new Eina_Future API. 2017-09-04 10:24:00 -03:00
Gustavo Sverzut Barbieri 08c38713ce do not emit events from efl_io_closer_close() on destructor.
On destructor we're not supposed to emit events, I even thought that
would be implicit, but it's not. If we do, for example an event
handler that would 'efl_del()' on "EFL_IO_CLOSER_EVENT_CLOSED" would
trigger too-many unrefs.
2016-12-20 10:18:32 -02:00
Gustavo Sverzut Barbieri a995529a46 efl_net_socket_udp: expose init() as protected method.
remove one more TODO: since Efl.Net.Ip.Address was introduced we can
now expose Efl.Net.Socket.Udp.init as a protected method that will
configure the internal address we use for the remote peer. This allow
subclasses to override or call such methods.
2016-12-19 17:11:46 -02:00
Gustavo Sverzut Barbieri 96eccc2753 efl_net: move error COULDNT_RESOLVE_HOST to broader scope.
This error is shared by Dialer and Server, will also be used by IP
resolution.
2016-12-12 02:30:33 -02:00
Gustavo Sverzut Barbieri 5939f0d9c2 efl_net_dialer: emit 'resolved' even if connection failed.
If we resolved the address but couldn't connect, use
efl_net_socket_address_remote_set() and emit
EFL_NET_DIALER_EVENT_RESOLVED.
2016-12-09 13:47:04 -02:00
Gustavo Sverzut Barbieri 371a3332ef efl_net: remove getsockopt()/setsockopt() warning on windows.
windows is nasty and defines the value to be set or retrieved as
'char *', which triggers a warning when we use another kind of
pointer.

Partially addresses D4357.
2016-11-18 12:53:32 -02:00
Gustavo Sverzut Barbieri 5818dc71da efl_net: use SOCKET_FMT to format SOCKET so it works on UNIX and Windows.
On Windows SOCKET is unsigned, thus will cause sign errors when
formatting with "%d" or comparing with signed values.

On UNIX it was quiet and easy to miss, thus a new #define can be used
to check for those. It will use 'unsigned long' as SOCKET, thus will
complain out loud and not even work correctly when using pointers on
64bits UNIX on mistakes -- which should improve the situation.

This helped to fix lots of missing conversions, all fixed.

This partially addresses D4357.
2016-11-18 12:53:32 -02:00
Gustavo Sverzut Barbieri 8a2ecda4d4 efl_net_dialer_udp: remove redundant thread cancel.
it was already done lines above, likely c&p left over.
2016-11-10 00:15:36 -02:00
Gustavo Sverzut Barbieri 9a62932d07 use more standard IPV6_JOIN_GROUP and IPV6_LEAVE_GROUP.
The IPV6_ADD_MEMBERSHIP and IPV6_DROP_MEMBERSHIP are deprecated alias,
use the correct defines so it compiles everywhere.

Fixes T4764

Thanks netstar!
2016-10-25 19:32:07 -02:00
Gustavo Sverzut Barbieri cd53f9bad2 efl_net_*_udp: make UDP usable, including multicast.
This was a huge work, but now UDP is usable as seen in the examples.

Instead of relying on 'connect()', just do 'sendto()' and 'recvfrom()'
as they are universal. Multicast address can only be connected in
IPv4, IPv6 wasn't working and I'm not sure the IPv4 is portable to
other platforms.

Dialer will auto-join multicast groups is the dialed address is
one. Multicast properties such as time to live (hops) and loopback can
be configured. When joining multicast groups, the local
address/interface can be configured by 'IP@IFACE' format, with
'@IFACE' being optional.

Dialers will now auto-bind, so it can receive data as dialers are
expected to be bi-directional. One can manually specify the binding
address if there is such need.

Since datagrams must be read in their full size, otherwise the
remaining bits are dropped, expose next_datagram_size_query() in both
Efl.Net.Socket.Udp and Efl.Net.Server.Udp.Client.

To finalize UDP for real we need to introduce an 'Efl_Net_Ip_Address'
structure to serve as both IPv4 and IPv6 and expose 'sendto()' and
'recvfrom()'. These will come later as this commit is already too big.
2016-10-25 10:11:48 -02:00
Gustavo Sverzut Barbieri cddbce8900 efl_net_*: improve WIN32.
Thanks to vtorri for poiting out about close() is not the correct
socket function, we should use closesocket() instead.

Also defined SOCKET to int on Linux so we can use the same 'type' and
avoid lots of ifdef in our code. On Windows it's unsigned, thus would
cause some warnings about incorrect signed comparison.
2016-10-22 21:49:01 -02:00
Gustavo Sverzut Barbieri 278866da2c efl_net_dialer_udp: "connect" to an UDP server to send and receive data.
Like existing ecore_con code, this does not use SOCKSv5 UDP
proxy. It's kinda cumbersome to add since requires a keep alive TCP
connection to the server, a second UDP channel and framing around the
original UDP frame.

Added UDP_CORK (if present) to match TCP_UDP present in TCP sockets,
this allows one to execute multiple write() calls that will result in
a single datagram, generated when CORK becomes FALSE again.

The efl_io_copier_example.c now accepts this as output. There is no
input UDP as there is no way to notify the server of a connection
(since such thing doesn't exit), usually servers react after a
datagram is received, replying to the source.
2016-10-18 19:04:00 -02:00