aboutsummaryrefslogtreecommitdiffstats
path: root/pages/develop/api/efl/net/server/udp/method/socket_activate.txt
blob: 5a1d3399120035313357dc146381f813b62c691e (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
~~Title: Efl.Net.Server.Udp.socket_activate~~
===== Description =====

%%If this method is called use an already activated socket.%%

%%This method allows a server to use an existing socket received from systemd or similar system.%%

%%It will replace %%[[:develop:api:efl:net:server:method:serve|Efl.Net.Server.serve]]%%, thus if this is used, that method will return EALREADY.%%

%%@note The parameter 'address' given to this function is only used to validate the next socket available, it doesn't search for a socket with the given address. Thus the socket to be used is the next unused and orders matter is using multiple servers!%%

%%@note subclasses must validate the socket and return EINVAL prior to call the base class with Efl.Object.super. They must also emit "serving" when ready, for instance stream protocols may need to check for listening and if not try to listen. Usually they will also query getsockname() and set %%[[:develop:api:efl:net:server:property:address|Efl.Net.Server.address]]%%.%%

%%Errors:%%

%%- EALREADY: already have a socket, either from previous %%[[:develop:api:efl:net:server:fd:method:socket_activate|Efl.Net.Server.Fd.socket_activate]]%% or %%[[:develop:api:efl:net:server:method:serve|Efl.Net.Server.serve]]%%. Usually represents a programming error.%%

%%- ENOENT: no sockets received from process manager (ie: systemd). Usually this is not a fatal error, just proceed by calling %%[[:develop:api:efl:net:server:method:serve|Efl.Net.Server.serve]]%%%%

%%- EINVAL: the socket received is not of the correct family, type or protocol. Usually this means a configuration mismatch with the order of server creation and calls to socket_activate. The systemd.socket entries must match the order in your application.%%

//Since 1.19//
{{page>:develop:api-include:efl:net:server:udp:method:socket_activate:description&nouser&nolink&nodate}}

//Overridden from [[:develop:api:efl:net:server:fd:method:socket_activate|Efl.Net.Server.Fd.socket_activate]].//===== Signature =====

<code>
socket_activate {
    params {
        @in address: free(string, free);
    }
    return: Eina.Error;
}
</code>

===== C signature =====

<code c>
Eina_Error efl_net_server_fd_socket_activate(Eo *obj, const char *address);
</code>

===== Parameters =====

  * **address** //(in)// - %%The address to validate the next available socket. It doesn't serve as search, only as validation!%%

===== Implemented by =====

  * [[:develop:api:efl:net:server:fd:method:socket_activate|Efl.Net.Server.Fd.socket_activate]]