aboutsummaryrefslogtreecommitdiffstats
path: root/pages/develop/api/efl/net/server/fd/method/client_announce.txt
blob: 163b156a9b6ed9ac475cd276b4f3502cf21c7ccc (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
~~Title: Efl.Net.Server.Fd.client_announce~~
===== Description =====

%%Implementions should call this method to announce new clients.%%

%%This method will account the new client in %%[[:develop:api:efl:net:server:property:clients_count|Efl.Net.Server.clients_count]]%% as well as emit the event "client,add".%%

%%After this call, the client ownership will be managed. If no event handler references the object, it will be deleted.%%

%%Most implementions will do the sequence:%%

%%- emit "client,add"%%

%%- check if client was referenced%%

%%- if we're not the parent anymore, ignore (do not change %%[[:develop:api:efl:net:server:property:clients_count|Efl.Net.Server.clients_count]]%%) and return %%''true''%%.%%

%%- if not referenced, delete it and return %%''false''%%.%%

%%- if it's closed, delete it and return %%''false''%%.%%

%%- if referenced, increment %%[[:develop:api:efl:net:server:property:clients_count|Efl.Net.Server.clients_count]]%% and monitor for client "closed" event and return %%''true''%%.%%

%%- on client "closed", decrease %%[[:develop:api:efl:net:server:property:clients_count|Efl.Net.Server.clients_count]]%% and unset its parent (if we're still the parent).%%

%%Do not monitor "closed" before emitting "client,add". Doing so may lead to double free if callbacks close the client by themselves!%%

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

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

<code>
client_announce @protected @pure_virtual {
    params {
        @in client: free(Efl.Net.Socket, efl_del);
    }
    return: bool (false);
}
</code>

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

<code c>
Eina_Bool efl_net_server_client_announce(Eo *obj, Efl_Net_Socket *client);
</code>

===== Parameters =====

  * **client** //(in)// - %%A socket representing the client.%%

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

  * [[:develop:api:efl:net:server:method:client_announce|Efl.Net.Server.client_announce]]