summaryrefslogtreecommitdiff
path: root/src/lib/ecore_con/efl_net_server_udp.eo
blob: 21c644e6e12ecd85e438e5de76f6f9b06d3de92b (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
class Efl.Net.Server.Udp (Efl.Net.Server.Fd) {
    [[A UDP server.

      @since 1.19
    ]]

    methods {
        @property ipv6_only {
            [[Whenever IPv6 listen address will accept only same-family clients or will allow IPv4 to connect as well.

              Since Linux 2.4.21, Windows Vista and MacOS X these
              control whenever a server that did bind to an IPv6
              address will accept only IPv6 clients or will also
              accept IPv4 by automatically converting them in an IPv6
              address, allowing a single socket to handle both
              protocols.

              If an IPv6 address was used in @Efl.Net.Server.address,
              this property is $false and an IPv4 connects, then an
              address such as [::ffff:IPv4]:PORT will be used, such as
              [::ffff:192.168.0.2]:1234, where the IPv4 address can be
              extracted.

              If an IPv4 address was used in @Efl.Net.Server.address,
              this has no effect.

              Systems can configure their default value, usually true
              (allows only IPv6 clients).
            ]]
            values {
                ipv6_only: bool; [[If $true the server will only accept IPv6 clients, $false otherwise]]
            }
        }

        @property dont_route {
            [[Avoid sent UDP packets being routed by a gateway, limiting them to the local network.

              This will use SO_DONTROUTE option to avoid gateways
              routing sent packets to outside of local network. It's
              useful for some protocols that only want local area to
              be affected.
            ]]
            get { }
            set {
                return: bool (false); [[$true on success]]
            }
            values {
                dont_route: bool; [[If $true limit packets to the local network, $false otherwise]]
            }
        }

        multicast_join {
            [[Join a multicast group.

              The multicast address should be in the format:

                 IP\@INTERFACE

              With '\@INTERFACE' being optional, such as:

                 224.0.0.1 - use any interface (ie: 0.0.0.0)
                 224.0.0.1@0.0.0.0
                 224.0.0.1@192.168.0.1 - use the interface assigned to 192.168.0.1
                 ff02::1@0 - use any interface
                 ff02::1@1 - use loopback interface (idx=1)
            ]]
            params {
                address: string @nonull; [[Multicast group address]]
            }
            return: Eina.Error; [[0 on success, error code otherwise]]
        }

        multicast_leave {
            [[Leave a multicast group.

              This reverses the effect of @.multicast_join.
            ]]
            params {
                address: string @nonull; [[Multicast group address]]
            }
            return: Eina.Error; [[0 on success, error code otherwise]]
        }

        multicast_groups_get {
            [[Return the multicast groups this server has joined.

              The iterator is only valid until a new group is joined
              or left using @.multicast_join or @.multicast_leave.
            ]]
            return: free(own(iterator<string>), eina_iterator_free); [[List of multicast groups]]
        }

        @property multicast_time_to_live {
            [[Controls time to live in number of hops.

              If 1 (default), packets are only delivered to the local network.
            ]]
            get { }
            set {
                return: Eina.Error; [[0 on success, error code otherwise]]
            }
            values {
                ttl: uint8; [[Time to live]]
            }
        }

        @property multicast_loopback {
            [[Controls whenever multicast will loopback packets locally.

              If $false, then packets won't be looped back locally,
              just delivered for remote peers.
            ]]
            get { }
            set {
                return: Eina.Error; [[0 on success, error code otherwise]]
            }
            values {
                loopback: bool; [[$true when multicast packets are looped back, $false otherwise]]
            }
        }
    }

    implements {
        Efl.Object.constructor;
        Efl.Object.destructor;
        Efl.Net.Server.serve;
        Efl.Net.Server.Fd.process_incoming_data;
        Efl.Net.Server.Fd.socket_activate;
    }
}