forked from enlightenment/efl
132 lines
4.8 KiB
Plaintext
132 lines
4.8 KiB
Plaintext
var Efl.Net.Dialer.Error.COULDNT_CONNECT: Eina.Error; [[The dialer could not connect to the remote]]
|
|
var Efl.Net.Dialer.Error.COULDNT_RESOLVE_PROXY: Eina.Error; [[The dialer could not resolve the given proxy server]]
|
|
var Efl.Net.Dialer.Error.PROXY_AUTHENTICATION_FAILED: Eina.Error; [[The dialer failed to authenticate against the proxy server]]
|
|
|
|
interface Efl.Net.Dialer (Efl.Net.Socket) {
|
|
[[Creates a client socket to reach a remote peer.
|
|
|
|
The connection process starts when @.dial is executed, this
|
|
allows implementations to request more complex setup that would
|
|
require a live object handle that is not possible during
|
|
construction.
|
|
|
|
The socket should be considered connected and ready to use only
|
|
when "connected" event is dispatched, by then
|
|
@Efl.Io.Reader.can_read and @Efl.Io.Writer.can_write should
|
|
change accordingly.
|
|
|
|
Once the socket is closed, @Efl.Io.Closer.closed will be called
|
|
and the "closed" event is dispatched.
|
|
|
|
@since 1.19
|
|
]]
|
|
methods {
|
|
dial {
|
|
[[Dials to the remote peer.
|
|
|
|
This method starts the connection process, resolving
|
|
address and then proceeding to the actual connection.
|
|
|
|
Once the connection is fully setup, "connected" event is
|
|
dispatched.
|
|
]]
|
|
params {
|
|
address: string @nonull; [[Remote address]]
|
|
}
|
|
return: Eina.Error; [[0 on success, error code otherwise]]
|
|
}
|
|
|
|
@property address_dial {
|
|
[[Returns the address given to @.dial.
|
|
|
|
If the resolved address is desired, then listen to
|
|
"resolved" event and use the
|
|
@Efl.Net.Socket.address_remote property.
|
|
]]
|
|
get { }
|
|
set @protected { }
|
|
values {
|
|
address: string; [[Remote address]]
|
|
}
|
|
}
|
|
|
|
@property connected {
|
|
[[Returns whenever the socket is connected or not.
|
|
|
|
Whenever this property becomes true, "connected" event
|
|
should be dispatched.
|
|
]]
|
|
get { }
|
|
set @protected { }
|
|
values {
|
|
connected: bool; [[$true if the socket is connected, $false otherwise]]
|
|
}
|
|
}
|
|
|
|
@property proxy {
|
|
[[Controls/retrieves if the dialer should use a proxy.
|
|
|
|
The proxy is an URL in the form:
|
|
|
|
- protocol://username:password\@proxyserver:port
|
|
|
|
Where protocol is defined per class, such as a TCP or
|
|
UDP dialer will use 'socks4', 'socks4a', 'socks5' or
|
|
'socks5h'; while http and websocket will want those or
|
|
'http'.
|
|
|
|
Whenever appropriate dialers may use system proxy if the
|
|
proxy is NULL (the default). To forcefully disable
|
|
proxy, use an empty string ("").
|
|
|
|
- http://username:password\@proxyserver:port
|
|
- http://username\@proxyserver:port
|
|
- http://proxyserver:port
|
|
- http://proxyserver (default port)
|
|
- 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)
|
|
]]
|
|
get { }
|
|
set { }
|
|
values {
|
|
proxy_url: string; [[May be empty or NULL to unset]]
|
|
}
|
|
}
|
|
|
|
@property timeout_dial {
|
|
[[The timeout in seconds to use for dialing/connecting.
|
|
|
|
This should be set before dialing.
|
|
]]
|
|
get { }
|
|
set { }
|
|
values {
|
|
seconds: double; [[Timeout value is seconds]]
|
|
}
|
|
}
|
|
}
|
|
|
|
events {
|
|
resolved: string; [[Notifies @.address_dial was resolved to
|
|
@Efl.Net.Socket.address_remote.
|
|
|
|
This is emitted before "connected" and may
|
|
be emitted from @Efl.Object.finalize, thus
|
|
be sure to connect the callbacks during
|
|
the object construction.
|
|
|
|
Some protocols allows redirects and this
|
|
may be emitted multiple times, such as
|
|
HTTP.
|
|
]]
|
|
error: Eina.Error; [[Some error happened and the socket
|
|
stopped working.
|
|
]]
|
|
connected; [[Notifies the socket is connected to the remote peer.]]
|
|
}
|
|
}
|