2019-02-14 08:37:02 -08:00
|
|
|
class @beta Efl.Net.Dialer_Tcp extends Efl.Net.Socket_Tcp implements Efl.Net.Dialer {
|
efl.net: socket, server and dialer for TCP.
Efl.Net.Server defines how to accept new connections, doing the
bind(), listen() and accept() for protocols such as TCP.
Efl.Net.Dialer defines to to reach a server.
Both are based on Efl.Net.Socket as communication interface that is
based on Efl.Io.Reader, Efl.Io.Writer and Efl.Io.Closer, thus being
usable with code such as Efl.Io.Copier.
The Server will emit an event "client,add" with the established
Socket, which is a child and can be closed by both the server or the
user.
The Dialer extends the Socket and allows for creating one given an
address, that will be resolved and connected.
TCP is the initial implementation so we an validate the
interfaces. UDP, Unix-Local and SSL will come later as derivate
classes.
The examples are documented and should cover the basic principles:
- efl_io_copier_example can accept "tcp://IP:PORT" and will work as a
"netcat", can send data from socket, file or stdin to a socket,
file, stdout or stderr.
- efl_net_server_example listens for connections and can either reply
"Hello World!" and take some data or work as an echo-server,
looping back all received data to the user.
More complex interactions that require a "chat" between client and
server will be covered with new classes later, such as a queue that
empties itself once data is read.
2016-08-17 21:53:16 -07:00
|
|
|
[[Connects to a remote TCP server.
|
|
|
|
|
2019-09-10 07:05:44 -07:00
|
|
|
If the proxy is $NULL (default), then the system proxy will be
|
2016-09-16 18:19:37 -07:00
|
|
|
used. On UNIX that's the environment variable $socks_proxy (or
|
|
|
|
'$proxy' or '$all_proxy') is used if the given address doesn't
|
|
|
|
match $no_proxy patterns. To disable proxy use an empty string.
|
|
|
|
|
2019-09-10 07:05:44 -07:00
|
|
|
If the proxy is $NULL (default), then the system proxy will be
|
2016-09-16 18:19:37 -07:00
|
|
|
used. On UNIX that's the environment variable $socks_proxy (or
|
|
|
|
'$all_proxy') is used if the given address doesn't match
|
|
|
|
$no_proxy patterns. To disable proxy use an empty string. If
|
|
|
|
provided proxy must be one of the protocols:
|
|
|
|
|
|
|
|
- socks5://username:password\@proxyserver:port (SOCKSv5)
|
|
|
|
- socks5h://username\@proxyserver:port (let socks server to resolve domain)
|
|
|
|
- socks5://proxyserver:port
|
|
|
|
- socks5://proxyserver (default port 1080)
|
|
|
|
- socks4a://proxyserver:port (SOCKSv4 and let socks server to resolve domain)
|
|
|
|
- socks4://proxyserver:port (SOCKSv4)
|
efl.net: socket, server and dialer for TCP.
Efl.Net.Server defines how to accept new connections, doing the
bind(), listen() and accept() for protocols such as TCP.
Efl.Net.Dialer defines to to reach a server.
Both are based on Efl.Net.Socket as communication interface that is
based on Efl.Io.Reader, Efl.Io.Writer and Efl.Io.Closer, thus being
usable with code such as Efl.Io.Copier.
The Server will emit an event "client,add" with the established
Socket, which is a child and can be closed by both the server or the
user.
The Dialer extends the Socket and allows for creating one given an
address, that will be resolved and connected.
TCP is the initial implementation so we an validate the
interfaces. UDP, Unix-Local and SSL will come later as derivate
classes.
The examples are documented and should cover the basic principles:
- efl_io_copier_example can accept "tcp://IP:PORT" and will work as a
"netcat", can send data from socket, file or stdin to a socket,
file, stdout or stderr.
- efl_net_server_example listens for connections and can either reply
"Hello World!" and take some data or work as an echo-server,
looping back all received data to the user.
More complex interactions that require a "chat" between client and
server will be covered with new classes later, such as a queue that
empties itself once data is read.
2016-08-17 21:53:16 -07:00
|
|
|
]]
|
|
|
|
|
|
|
|
implements {
|
2016-09-12 10:48:03 -07:00
|
|
|
Efl.Object.constructor;
|
2018-04-17 16:17:29 -07:00
|
|
|
Efl.Object.invalidate;
|
efl.net: socket, server and dialer for TCP.
Efl.Net.Server defines how to accept new connections, doing the
bind(), listen() and accept() for protocols such as TCP.
Efl.Net.Dialer defines to to reach a server.
Both are based on Efl.Net.Socket as communication interface that is
based on Efl.Io.Reader, Efl.Io.Writer and Efl.Io.Closer, thus being
usable with code such as Efl.Io.Copier.
The Server will emit an event "client,add" with the established
Socket, which is a child and can be closed by both the server or the
user.
The Dialer extends the Socket and allows for creating one given an
address, that will be resolved and connected.
TCP is the initial implementation so we an validate the
interfaces. UDP, Unix-Local and SSL will come later as derivate
classes.
The examples are documented and should cover the basic principles:
- efl_io_copier_example can accept "tcp://IP:PORT" and will work as a
"netcat", can send data from socket, file or stdin to a socket,
file, stdout or stderr.
- efl_net_server_example listens for connections and can either reply
"Hello World!" and take some data or work as an echo-server,
looping back all received data to the user.
More complex interactions that require a "chat" between client and
server will be covered with new classes later, such as a queue that
empties itself once data is read.
2016-08-17 21:53:16 -07:00
|
|
|
Efl.Object.destructor;
|
|
|
|
Efl.Net.Dialer.dial;
|
2017-01-11 07:35:03 -08:00
|
|
|
Efl.Net.Dialer.address_dial { get; set; }
|
|
|
|
Efl.Net.Dialer.connected { get; set; }
|
|
|
|
Efl.Net.Dialer.proxy { get; set; }
|
|
|
|
Efl.Net.Dialer.timeout_dial { get; set; }
|
efl.net: socket, server and dialer for TCP.
Efl.Net.Server defines how to accept new connections, doing the
bind(), listen() and accept() for protocols such as TCP.
Efl.Net.Dialer defines to to reach a server.
Both are based on Efl.Net.Socket as communication interface that is
based on Efl.Io.Reader, Efl.Io.Writer and Efl.Io.Closer, thus being
usable with code such as Efl.Io.Copier.
The Server will emit an event "client,add" with the established
Socket, which is a child and can be closed by both the server or the
user.
The Dialer extends the Socket and allows for creating one given an
address, that will be resolved and connected.
TCP is the initial implementation so we an validate the
interfaces. UDP, Unix-Local and SSL will come later as derivate
classes.
The examples are documented and should cover the basic principles:
- efl_io_copier_example can accept "tcp://IP:PORT" and will work as a
"netcat", can send data from socket, file or stdin to a socket,
file, stdout or stderr.
- efl_net_server_example listens for connections and can either reply
"Hello World!" and take some data or work as an echo-server,
looping back all received data to the user.
More complex interactions that require a "chat" between client and
server will be covered with new classes later, such as a queue that
empties itself once data is read.
2016-08-17 21:53:16 -07:00
|
|
|
Efl.Io.Closer.close;
|
|
|
|
}
|
|
|
|
}
|