Efl.Net.Server (interface)

Description

The basic server interface.

This will start serving and accepting clients once Efl.Net.Server.serve is called and the "serving" event is dispatched.

When new clients are accepted the "client,add" event is dispatched with a child object implementing Efl.Net.Socket interface. These implement the standard Efl.Io.Reader, Efl.Io.Writer and Efl.Io.Closer interfaces, so can be used with utilities such as Efl.Io.Copier.

Since 1.19

Members

address (get, set) protected set

The address to which the server is bound.
const char *efl_net_server_address_get(const Eo *obj);
void efl_net_server_address_set(Eo *obj, const char *address);


clients_count (get, set) protected set

Number of concurrent clients accepted by the server.
unsigned int efl_net_server_clients_count_get(const Eo *obj);
void efl_net_server_clients_count_set(Eo *obj, unsigned int count);


clients_limit (get, set)

Number of maximum concurrent clients allowed by the server.
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);


serve

Starts serving requests.
Eina_Error efl_net_server_serve(Eo *obj, const char *address);


serving (get, set) protected set

Returns whenever the server is ready to accept clients or not.
Eina_Bool efl_net_server_serving_get(const Eo *obj);
void efl_net_server_serving_set(Eo *obj, Eina_Bool serving);


client_announce protected

Implementions should call this method to announce new clients.
Eina_Bool efl_net_server_client_announce(Eo *obj, Efl_Net_Socket *client);


Events

client,add

A new client socket has been created.
EFL_NET_SERVER_EVENT_CLIENT_ADD(Efl_Net_Socket *, @hot)


client,rejected

Notifies a client was rejected due excess, see Efl.Net.Server.clients_limit.
EFL_NET_SERVER_EVENT_CLIENT_REJECTED(const char *)


error

An error has occurred and the server needs to be stopped.
EFL_NET_SERVER_EVENT_ERROR(Eina_Error)


serving

Notifies the server is ready to accept clients. See property Efl.Net.Server.serving
EFL_NET_SERVER_EVENT_SERVING(void)