aboutsummaryrefslogtreecommitdiffstats
path: root/pages/develop/api/efl/net/server.txt
blob: e13631eccf1878b55bcb12b5c7887aaf5aeea17b (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
~~Title: Efl.Net.Server~~
====== Efl.Net.Server (interface) ======

===== Description =====

%%The basic server interface.%%

%%It will start serving and accepting clients once %%[[:develop:api:efl:net:server:method:serve|Efl.Net.Server.serve]]%% is called and the "serving" event is dispatched.%%

%%When new clients are accepted, then "client,add" event is dispatched with a child object implementing %%[[:develop:api:efl:net:socket|Efl.Net.Socket]]%% interface. These implement the standard %%[[:develop:api:efl:io:reader|Efl.Io.Reader]]%%, %%[[:develop:api:efl:io:writer|Efl.Io.Writer]]%% and %%[[:develop:api:efl:io:closer|Efl.Io.Closer]]%% interfaces, thus can be used with utilities such as %%[[:develop:api:efl:io:copier|Efl.Io.Copier]]%%.%%

//Since 1.19//

{{page>:develop:api-include:efl:net:server:description&nouser&nolink&nodate}}

===== Inheritance =====


++++ Inheritance graph |

<graphviz>
digraph hierarchy {
    bgcolor = "transparent"
    size = "6"
    rankdir = "TB"

    node [shape = "box"]
    edge [color = "gray35"]

    efl_net_server [fillcolor = "dodgerblue4", label = "Efl.Net.Server", color = "cornflowerblue", fontcolor = "white", style = "filled"]

}
</graphviz>

++++

++++ Full hierarchy |



++++
===== Members =====

**[[:develop:api:efl:net:server:method:serve|serve]]**\\
> %%Starts serving requests.%%
<code c>
Eina_Error efl_net_server_serve(Eo *obj, const char *address);
</code>
\\
**[[:develop:api:efl:net:server:property:address|address]]** //**(get, set)**// ''protected set''\\
> %%The address the server is bound to.%%
<code c>
const char *efl_net_server_address_get(const Eo *obj);
void efl_net_server_address_set(Eo *obj, const char *address);
</code>
\\
**[[:develop:api:efl:net:server:property:clients_count|clients_count]]** //**(get, set)**// ''protected set''\\
> %%Number of concurrent clients accepted by this server.%%
<code c>
unsigned int efl_net_server_clients_count_get(const Eo *obj);
void efl_net_server_clients_count_set(Eo *obj, unsigned int count);
</code>
\\
**[[:develop:api:efl:net:server:property:clients_limit|clients_limit]]** //**(get, set)**//\\
> %%Number of maximum concurrent clients allowed by this server.%%
<code c>
void efl_net_server_clients_limit_get(const Eo *obj, unsigned int *limit, Eina_Bool *reject_excess);
void efl_net_server_clients_limit_set(Eo *obj, unsigned int limit, Eina_Bool reject_excess);
</code>
\\
**[[:develop:api:efl:net:server:property:serving|serving]]** //**(get, set)**// ''protected set''\\
> %%Returns whenever the server is ready to accept clients or not.%%
<code c>
Eina_Bool efl_net_server_serving_get(const Eo *obj);
void efl_net_server_serving_set(Eo *obj, Eina_Bool serving);
</code>
\\
**[[:develop:api:efl:net:server:method:client_announce|client_announce]]** ''protected''\\
> %%Implementions should call this method to announce new clients.%%
<code c>
Eina_Bool efl_net_server_client_announce(Eo *obj, Efl_Net_Socket *client);
</code>
\\

===== Events =====

**[[:develop:api:efl:net:server:event:client_add|client,add]]**\\
> %%A new client socket was created.%%
<code c>
EFL_NET_SERVER_EVENT_CLIENT_ADD(Efl_Net_Socket *, @hot)
</code>
\\ **[[:develop:api:efl:net:server:event:client_rejected|client,rejected]]**\\
> %%Notifies a client was rejected due excess, see %%[[:develop:api:efl:net:server:property:clients_limit|Efl.Net.Server.clients_limit]]%%.%%
<code c>
EFL_NET_SERVER_EVENT_CLIENT_REJECTED(const char *)
</code>
\\ **[[:develop:api:efl:net:server:event:error|error]]**\\
> %%Some error happened and the server needs to be stopped.%%
<code c>
EFL_NET_SERVER_EVENT_ERROR(Eina_Error)
</code>
\\ **[[:develop:api:efl:net:server:event:serving|serving]]**\\
> %%Notifies the server is ready to accept clients. See property %%[[:develop:api:efl:net:server:property:serving|Efl.Net.Server.serving]]%%%%
<code c>
EFL_NET_SERVER_EVENT_SERVING(void)
</code>
\\