2019-02-14 08:37:02 -08:00
|
|
|
class @beta Efl.Net.Server_Simple extends Efl.Loop_Consumer implements Efl.Net.Server {
|
2018-04-13 01:54:41 -07:00
|
|
|
[[A network server wrapper that creates clients based on @Efl.Net.Socket_Simple.
|
efl_net_{socket,dialer,server}_simple: easy to use, buffered network sockets.
The low level I/O primitives are powerful but adds some complexity to
use, for bi-directional streaming communication one ends creating two
Efl.Io.Queue and two Efl.Io.Copier to pipe data to socket when it can
operate.
Then encapsulate the socket using the new Efl.Io.Buffered_Stream, this
will allow the socket, be a dialer or a server client, to be operated
as a single handle that internally carries about the buffering for
you.
As one can see in the examples, compared to their "manual"
alternatives they are very easy to use, ressembling
Ecore_Con_Server/Ecore_Con_Client, but also offers line-based
delimiters and the possibility to let the socket to handle queueing
for you in case you received partial messages (just do not
read/clear/discard the received data).
2016-11-25 11:18:34 -08:00
|
|
|
|
2017-12-20 09:30:29 -08:00
|
|
|
This is just a wrapper server. It takes an actual server
|
|
|
|
using @.inner_server or creates one using @.inner_class.
|
efl_net_{socket,dialer,server}_simple: easy to use, buffered network sockets.
The low level I/O primitives are powerful but adds some complexity to
use, for bi-directional streaming communication one ends creating two
Efl.Io.Queue and two Efl.Io.Copier to pipe data to socket when it can
operate.
Then encapsulate the socket using the new Efl.Io.Buffered_Stream, this
will allow the socket, be a dialer or a server client, to be operated
as a single handle that internally carries about the buffering for
you.
As one can see in the examples, compared to their "manual"
alternatives they are very easy to use, ressembling
Ecore_Con_Server/Ecore_Con_Client, but also offers line-based
delimiters and the possibility to let the socket to handle queueing
for you in case you received partial messages (just do not
read/clear/discard the received data).
2016-11-25 11:18:34 -08:00
|
|
|
]]
|
|
|
|
methods {
|
|
|
|
@property inner_class {
|
|
|
|
[[The class used to create @.inner_server if none was provided.
|
|
|
|
|
2017-12-20 09:30:29 -08:00
|
|
|
This class must be set at build time and will be
|
efl_net_{socket,dialer,server}_simple: easy to use, buffered network sockets.
The low level I/O primitives are powerful but adds some complexity to
use, for bi-directional streaming communication one ends creating two
Efl.Io.Queue and two Efl.Io.Copier to pipe data to socket when it can
operate.
Then encapsulate the socket using the new Efl.Io.Buffered_Stream, this
will allow the socket, be a dialer or a server client, to be operated
as a single handle that internally carries about the buffering for
you.
As one can see in the examples, compared to their "manual"
alternatives they are very easy to use, ressembling
Ecore_Con_Server/Ecore_Con_Client, but also offers line-based
delimiters and the possibility to let the socket to handle queueing
for you in case you received partial messages (just do not
read/clear/discard the received data).
2016-11-25 11:18:34 -08:00
|
|
|
used to create the inner socket during
|
|
|
|
@Efl.Object.finalize.
|
|
|
|
|
2017-12-20 09:30:29 -08:00
|
|
|
It is a helper for users, saving them the trouble of
|
|
|
|
manually creating and specifying a dialer object.
|
efl_net_{socket,dialer,server}_simple: easy to use, buffered network sockets.
The low level I/O primitives are powerful but adds some complexity to
use, for bi-directional streaming communication one ends creating two
Efl.Io.Queue and two Efl.Io.Copier to pipe data to socket when it can
operate.
Then encapsulate the socket using the new Efl.Io.Buffered_Stream, this
will allow the socket, be a dialer or a server client, to be operated
as a single handle that internally carries about the buffering for
you.
As one can see in the examples, compared to their "manual"
alternatives they are very easy to use, ressembling
Ecore_Con_Server/Ecore_Con_Client, but also offers line-based
delimiters and the possibility to let the socket to handle queueing
for you in case you received partial messages (just do not
read/clear/discard the received data).
2016-11-25 11:18:34 -08:00
|
|
|
]]
|
|
|
|
get {
|
|
|
|
[[The internal class used to create the inner dialer.]]
|
|
|
|
}
|
|
|
|
set {
|
|
|
|
[[Constructor-only property to define the class used to create the inner dialer.]]
|
|
|
|
}
|
|
|
|
values {
|
|
|
|
klass: const(Efl.Class); [[The class]]
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
@property inner_server {
|
|
|
|
[[The inner @Efl.Net.Server this wrapper operates on.]]
|
|
|
|
get {
|
|
|
|
[[The internal server used for actual operations, use with care!]]
|
|
|
|
}
|
|
|
|
set {
|
|
|
|
[[Constructor-only property to set the inner_server.]]
|
|
|
|
}
|
|
|
|
values {
|
|
|
|
server: Efl.Object; [[The server instance]]
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
implements {
|
|
|
|
Efl.Object.finalize;
|
2018-04-09 17:01:21 -07:00
|
|
|
Efl.Object.invalidate;
|
efl_net_{socket,dialer,server}_simple: easy to use, buffered network sockets.
The low level I/O primitives are powerful but adds some complexity to
use, for bi-directional streaming communication one ends creating two
Efl.Io.Queue and two Efl.Io.Copier to pipe data to socket when it can
operate.
Then encapsulate the socket using the new Efl.Io.Buffered_Stream, this
will allow the socket, be a dialer or a server client, to be operated
as a single handle that internally carries about the buffering for
you.
As one can see in the examples, compared to their "manual"
alternatives they are very easy to use, ressembling
Ecore_Con_Server/Ecore_Con_Client, but also offers line-based
delimiters and the possibility to let the socket to handle queueing
for you in case you received partial messages (just do not
read/clear/discard the received data).
2016-11-25 11:18:34 -08:00
|
|
|
Efl.Net.Server.serve;
|
|
|
|
Efl.Net.Server.client_announce;
|
2016-12-27 07:58:07 -08:00
|
|
|
Efl.Net.Server.address { get; }
|
|
|
|
Efl.Net.Server.clients_count { get; }
|
2017-01-11 07:35:03 -08:00
|
|
|
Efl.Net.Server.clients_limit { get; set; }
|
2016-12-27 07:58:07 -08:00
|
|
|
Efl.Net.Server.serving { get; }
|
efl_net_{socket,dialer,server}_simple: easy to use, buffered network sockets.
The low level I/O primitives are powerful but adds some complexity to
use, for bi-directional streaming communication one ends creating two
Efl.Io.Queue and two Efl.Io.Copier to pipe data to socket when it can
operate.
Then encapsulate the socket using the new Efl.Io.Buffered_Stream, this
will allow the socket, be a dialer or a server client, to be operated
as a single handle that internally carries about the buffering for
you.
As one can see in the examples, compared to their "manual"
alternatives they are very easy to use, ressembling
Ecore_Con_Server/Ecore_Con_Client, but also offers line-based
delimiters and the possibility to let the socket to handle queueing
for you in case you received partial messages (just do not
read/clear/discard the received data).
2016-11-25 11:18:34 -08:00
|
|
|
}
|
|
|
|
}
|