GObject.Object
Gio.SocketClient
Import line: | Gio = imports.gi.Gio; |
GIR File: | Gio-2.0.gir |
C documentation: | GSocketClient |
Class : | SocketClient |
Extends: | GObject.Object |
Properties | Defined By | |
---|---|---|
enable_proxy : gboolean
|
Gio.SocketClient | |
family : Gio.SocketFamily
|
Gio.SocketClient | |
local_address : Gio.SocketAddress
|
Gio.SocketClient | |
parent_instance : GObject.Object
read only
|
Gio.SocketClient | |
priv : Gio.SocketClientPrivate
read only
|
Gio.SocketClient | |
protocol : Gio.SocketProtocol
|
Gio.SocketClient | |
timeout : guint32
|
Gio.SocketClient | |
tls : gboolean
|
Gio.SocketClient | |
tls_validation_flags : Gio.TlsCertificateFlags
|
Gio.SocketClient | |
type : Gio.SocketType
|
Gio.SocketClient |
Method / Constructor | Defined By | |
---|---|---|
new Gio.SocketClient
(Object properties)
Create a new Gio.SocketClient
Create a new Gio.SocketClient
|
||
add_application_proxy
(String protocol)
:
none
Enable proxy protocols to be handled by the application.
Enable proxy protocols to be handled by the application. When the
indicated proxy protocol is returned by the GProxyResolver, GSocketClient will consider this protocol as supported but will not try find a GProxy instance to handle handshaking. The application must check for this case by calling g_socket_connection_get_remote_address() on the returned GSocketConnection, and seeing if it's a GProxyAddress of the appropriate type, to determine whether or not it needs to handle the proxy handshaking itself. This should be used for proxy protocols that are dialects of another protocol such as HTTP proxy. It also allows cohabitation of proxy protocols that are reused between protocols. A good example is HTTP. It can be used to proxy HTTP, FTP and Gopher and can also be use as generic socket proxy through the HTTP CONNECT method.
|
Gio.SocketClient | |
Tries to resolve the connectable and make a network connection to it.
Tries to resolve the connectable and make a network connection to it..
Upon a successful connection, a new GSocketConnection is constructed and returned. The caller owns this new object and must drop their reference to it when finished with it. The type of the GSocketConnection object returned depends on the type of the underlying socket that is used. For instance, for a TCP/IP connection it will be a GTcpConnection. The socket created will be the same family as the the address that the or indirectly via g_socket_client_set_local_address(). The socket type defaults to G_SOCKET_TYPE_STREAM but can be set with g_socket_client_set_socket_type(). If a local address is specified with g_socket_client_set_local_address() the socket will be bound to this address before connecting.
|
Gio.SocketClient | |
connect_async
(SocketConnectable connectable, Cancellable cancellable, Function callback, void* user_data)
:
none
This is the asynchronous version of g_socket_client_connect().
This is the asynchronous version of g_socket_client_connect().
When the operation is finished callback will be called. You can then call g_socket_client_connect_finish() to get the result of the operation.
|
Gio.SocketClient | |
connect_finish
(AsyncResult result)
:
Gio.SocketConnection
Finishes an async connect operation.
Finishes an async connect operation. See g_socket_client_connect_async()
|
Gio.SocketClient | |
connect_to_host
(String host_and_port, guint16 default_port, Cancellable cancellable)
:
Gio.SocketConnection
This is a helper function for g_socket_client_connect().
This is a helper function for g_socket_client_connect().
Attempts to create a TCP connection to the named host. address, an IPv4 address, or a domain name (in which case a DNS lookup is performed). Quoting with [] is supported for all address types. A port override may be specified in the usual way with a colon. Ports may be given as decimal numbers or symbolic names (in which case an /etc/services lookup is performed). If no port override is given in host_and_port then default_port will be used as the port number to connect to. In general, host_and_port is expected to be provided by the user (allowing them to give the hostname, and a port overide if necessary) and In the case that an IP address is given, a single connection attempt is made. In the case that a name is given, multiple connection attempts may be made, in turn and according to the number of address records in DNS, until a connection succeeds. Upon a successful connection, a new GSocketConnection is constructed and returned. The caller owns this new object and must drop their reference to it when finished with it. In the event of any failure (DNS error, service not found, no hosts connectable) NULL is returned and error (if non-NULL) is set accordingly.
|
Gio.SocketClient | |
connect_to_host_async
(String host_and_port, guint16 default_port, Cancellable cancellable, Function callback, void* user_data)
:
none
This is the asynchronous version of g_socket_client_connect_to_host().
This is the asynchronous version of g_socket_client_connect_to_host().
When the operation is finished callback will be called. You can then call g_socket_client_connect_to_host_finish() to get the result of the operation.
|
Gio.SocketClient | |
connect_to_host_finish
(AsyncResult result)
:
Gio.SocketConnection
Finishes an async connect operation.
Finishes an async connect operation. See g_socket_client_connect_to_host_async()
|
Gio.SocketClient | |
Attempts to create a TCP connection to a service.
Attempts to create a TCP connection to a service.
This call looks up the SRV record for service at domain for the "tcp" protocol. It then attempts to connect, in turn, to each of the hosts providing the service until either a connection succeeds or there are no hosts remaining. Upon a successful connection, a new GSocketConnection is constructed and returned. The caller owns this new object and must drop their reference to it when finished with it. In the event of any failure (DNS error, service not found, no hosts connectable) NULL is returned and error (if non-NULL) is set accordingly.
|
Gio.SocketClient | |
connect_to_service_async
(String domain, String service, Cancellable cancellable, Function callback, void* user_data)
:
none
This is the asynchronous version of
g_socket_client_connect_to_service().
This is the asynchronous version of
g_socket_client_connect_to_service().
|
Gio.SocketClient | |
connect_to_service_finish
(AsyncResult result)
:
Gio.SocketConnection
Finishes an async connect operation.
Finishes an async connect operation. See g_socket_client_connect_to_service_async()
|
Gio.SocketClient | |
This is a helper function for g_socket_client_connect().
This is a helper function for g_socket_client_connect().
Attempts to create a TCP connection with a network URI. component. If a port is not specified in the URI, default_port will be used. TLS will be negotiated if GSocketClient:tls is TRUE. (GSocketClient does not know to automatically assume TLS for certain URI schemes.) Using this rather than g_socket_client_connect() or g_socket_client_connect_to_host() allows GSocketClient to determine when to use application-specific proxy protocols. Upon a successful connection, a new GSocketConnection is constructed and returned. The caller owns this new object and must drop their reference to it when finished with it. In the event of any failure (DNS error, service not found, no hosts connectable) NULL is returned and error (if non-NULL) is set accordingly.
|
Gio.SocketClient | |
connect_to_uri_async
(String uri, guint16 default_port, Cancellable cancellable, Function callback, void* user_data)
:
none
This is the asynchronous version of g_socket_client_connect_to_uri().
This is the asynchronous version of g_socket_client_connect_to_uri().
When the operation is finished callback will be called. You can then call g_socket_client_connect_to_uri_finish() to get the result of the operation.
|
Gio.SocketClient | |
connect_to_uri_finish
(AsyncResult result)
:
Gio.SocketConnection
Finishes an async connect operation.
Finishes an async connect operation. See g_socket_client_connect_to_uri_async()
|
Gio.SocketClient | |
get_enable_proxy
()
:
gboolean
Gets the proxy enable state; see g_socket_client_set_enable_proxy()
Gets the proxy enable state; see g_socket_client_set_enable_proxy()
|
Gio.SocketClient | |
get_family
()
:
Gio.SocketFamily
Gets the socket family of the socket client.
Gets the socket family of the socket client.
See g_socket_client_set_family() for details.
|
Gio.SocketClient | |
get_local_address
()
:
Gio.SocketAddress
Gets the local address of the socket client.
Gets the local address of the socket client.
See g_socket_client_set_local_address() for details.
|
Gio.SocketClient | |
get_protocol
()
:
Gio.SocketProtocol
Gets the protocol name type of the socket client.
Gets the protocol name type of the socket client.
See g_socket_client_set_protocol() for details.
|
Gio.SocketClient | |
get_socket_type
()
:
Gio.SocketType
Gets the socket type of the socket client.
Gets the socket type of the socket client.
See g_socket_client_set_socket_type() for details.
|
Gio.SocketClient | |
get_timeout
()
:
guint32
Gets the I/O timeout time for sockets created by client.
Gets the I/O timeout time for sockets created by client.
See g_socket_client_set_timeout() for details.
|
Gio.SocketClient | |
get_tls
()
:
gboolean
Gets whether client creates TLS connections.
Gets whether client creates TLS connections. See
g_socket_client_set_tls() for details.
|
Gio.SocketClient | |
get_tls_validation_flags
()
:
Gio.TlsCertificateFlags
Gets the TLS validation flags used creating TLS connections via
Gets the TLS validation flags used creating TLS connections via
|
Gio.SocketClient | |
set_enable_proxy
(gboolean enable)
:
none
Sets whether or not client attempts to make connections via a
proxy server.
Sets whether or not client attempts to make connections via a
proxy server. When enabled (the default), GSocketClient will use a GProxyResolver to determine if a proxy protocol such as SOCKS is needed, and automatically do the necessary proxy negotiation.
|
Gio.SocketClient | |
set_family
(SocketFamily family)
:
none
Sets the socket family of the socket client.
Sets the socket family of the socket client.
If this is set to something other than G_SOCKET_FAMILY_INVALID then the sockets created by this object will be of the specified family. This might be useful for instance if you want to force the local connection to be an ipv4 socket, even though the address might be an ipv6 mapped to ipv4 address.
|
Gio.SocketClient | |
set_local_address
(SocketAddress address)
:
none
Sets the local address of the socket client.
Sets the local address of the socket client.
The sockets created by this object will bound to the specified address (if not NULL) before connecting. This is useful if you want to ensure the the local side of the connection is on a specific port, or on a specific interface.
|
Gio.SocketClient | |
set_protocol
(SocketProtocol protocol)
:
none
Sets the protocol of the socket client.
Sets the protocol of the socket client.
The sockets created by this object will use of the specified protocol. If protocol is %0 that means to use the default protocol for the socket family and type.
|
Gio.SocketClient | |
set_socket_type
(SocketType type)
:
none
Sets the socket type of the socket client.
Sets the socket type of the socket client.
The sockets created by this object will be of the specified type. It doesn't make sense to specify a type of G_SOCKET_TYPE_DATAGRAM, as GSocketClient is used for connection oriented services.
|
Gio.SocketClient | |
set_timeout
(guint32 timeout)
:
none
Sets the I/O timeout for sockets created by client.
Sets the I/O timeout for sockets created by client. timeout is a
time in seconds, or 0 for no timeout (the default). The timeout value affects the initial connection attempt as well, so setting this may cause calls to g_socket_client_connect(), etc, to fail with G_IO_ERROR_TIMED_OUT.
|
Gio.SocketClient | |
set_tls
(gboolean tls)
:
none
Sets whether client creates TLS (aka SSL) connections.
Sets whether client creates TLS (aka SSL) connections. If tls is
TRUE, client will wrap its connections in a GTlsClientConnection and perform a TLS handshake when connecting. Note that since GSocketClient must return a GSocketConnection, but GTlsClientConnection is not a GSocketConnection, this actually wraps the resulting GTlsClientConnection in a GTcpWrapperConnection when returning it. You can use g_tcp_wrapper_connection_get_base_io_stream() on the return value to extract the GTlsClientConnection.
|
Gio.SocketClient | |
set_tls_validation_flags
(TlsCertificateFlags flags)
:
none
Sets the TLS validation flags used when creating TLS connections
via client.
Sets the TLS validation flags used when creating TLS connections
via client. The default value is G_TLS_CERTIFICATE_VALIDATE_ALL.
|
Gio.SocketClient |
None |