Commit Graph

14 Commits

Author SHA1 Message Date
Vincent Torri 092114ecc8 bin/eet and ecore_con: remove Evil.h when not necessary and include evil_private.h when necessary
Test Plan: compilation

Reviewers: raster, zmike, cedric

Reviewed By: zmike

Subscribers: #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D8911
2019-05-17 13:51:50 -04:00
Mike Blumenkrantz 049c65e7ac efl_io_*: apply new event calling convention
Summary:
ref T7758
Depends on D8409

Reviewers: cedric, zmike, segfaultxavi

Reviewed By: zmike

Subscribers: #reviewers, #committers

Tags: #efl

Maniphest Tasks: T7758

Differential Revision: https://phab.enlightenment.org/D8410
2019-03-19 16:32:02 -04:00
Mike Blumenkrantz 421bf2d0a3 api: add bool data to efl.io.reader/writer 'changed' events
Summary:
changed events should always be triggered with the accompanying changed
data to reduce function calls

ref T7600, T7599

Reviewers: cedric

Reviewed By: cedric

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Maniphest Tasks: T7600, T7599

Differential Revision: https://phab.enlightenment.org/D7984
2019-02-22 08:50:02 -05: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
Vincent Torri 0cdd501246 EFL For WIN32: Replace HAVE_EVIL define with _WIN32 2017-09-22 05:06:10 -05: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 963e3a793d efl_io_reader/writer: always set 'can_*' to FALSE on errors.
If user tries to read or write and that fails then set 'can_read' or
'can_write' to false, regardless of the error code.
2016-12-20 10:18:32 -02:00
Gustavo Sverzut Barbieri 42923bc29e 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.
2016-12-19 17:19:45 -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 6d1a54ed8e efl_net_server_udp_client: add missing part of name. 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 e6a78bd02a efl_net: play better with WIN32.
Defined INVALID_SOCKET=-1 and SOCKET_ERROR=-1 on non-Windows platforms
so we can keep the same construct 'function() == error' and it should
work on POSIX and windows.

I cannot test these on Windows, but the situation should be improved
with this commit.
2016-10-22 13:15:16 -02:00
Gustavo Sverzut Barbieri 7493368e54 efl_net_server_udp: initial UDP server.
This is the initial UDP server that works similarly to the TCP one,
however under the hood it's widely different since the socket is
reused for all "clients", thus needs a new Efl.Net.Server.Udp.Client
(Efl.Net.Socket) as Efl.Net.Socket.Udp exposes the fd and options such
as 'cork', which would interfere in other clients.

The main socket will read the packets and find an existing client to
feed it. If no client exists, then it will create one if not overr
limit. Since there is no kernel-queuing as done by listen()/accept(),
the 'no reject' case will just accept the client anyway.

Next commits will improve UDP server handling with some advanced
features:

 - join multicast groups
 - bind to a specific interface (SO_BINDTODEVICE)
 - block packets going out of local network (SO_DONTROUTE)
 - specify priorities (SO_PRIORITY)
2016-10-21 13:33:27 -02:00