Camel.NetworkService¶
- Implementations:
None
Methods¶
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Virtual Methods¶
|
|
|
|
|
Properties¶
Name |
Type |
Flags |
Short Description |
---|---|---|---|
r/w |
Socket endpoint of a network service |
||
r |
Whether the host is reachable |
Signals¶
None
Fields¶
None
Class Details¶
- class Camel.NetworkService¶
- Bases:
- Structure:
New in version 3.2.
- can_reach(cancellable, callback, *user_data)¶
- Parameters:
cancellable (
Gio.Cancellable
orNone
) – optionalGio.Cancellable
object, orNone
callback (
Gio.AsyncReadyCallback
orNone
) – aGio.AsyncReadyCallback
to call when the request is satisfieduser_data (
object
orNone
) – data to pass to the callback function
Asynchronously attempts to determine whether or not the host described by self's
Camel.NetworkService
:connectable
property can be reached, without actually trying to connect to it.For more details, see
Camel.NetworkService.can_reach_sync
().When the operation is finished, callback will be called. You can then call
Camel.NetworkService.can_reach_finish
() to get the result of the operation.New in version 3.12.
- can_reach_finish(result)¶
- Parameters:
result (
Gio.AsyncResult
) – aGio.AsyncResult
- Raises:
- Returns:
whether the host for self can be reached
- Return type:
Finishes the operation started with
Camel.NetworkService.can_reach
().New in version 3.12.
- can_reach_sync(cancellable)¶
- Parameters:
cancellable (
Gio.Cancellable
orNone
) – optionalGio.Cancellable
object, orNone
- Raises:
- Returns:
whether the host for self can be reached
- Return type:
Attempts to determine whether or not the host described by self's
Camel.NetworkService
:connectable
property can be reached, without actually trying to connect to it.If self believes an attempt to connect will succeed, the function returns
True
. Otherwise the function returnsFalse
and sets error to an appropriate error (such asGio.IOErrorEnum.HOST_UNREACHABLE
).The function will also update the self's
Camel.NetworkService
:host-reachable
property based on the result.New in version 3.12.
- connect_sync(cancellable)¶
- Parameters:
cancellable (
Gio.Cancellable
orNone
) – optionalGio.Cancellable
object, orNone
- Raises:
- Returns:
a
Gio.IOStream
, orNone
on error- Return type:
Attempts to establish a network connection to the server described by self, using the preferred
Camel.NetworkSettings
:security-method
to secure the connection. If a connection cannot be established, or the connection attempt is cancelled, the function sets error and returnsNone
.New in version 3.2.
- get_default_port(method)¶
- Parameters:
method (
Camel.NetworkSecurityMethod
) – aCamel.NetworkSecurityMethod
- Returns:
the default port number for self and method
- Return type:
Returns the default network port number for self and the security method method, as defined in /etc/services. For example, the default port for unencrypted IMAP or encrypted IMAP using STARTTLS is 143, but the default port for IMAP over SSL is 993.
New in version 3.2.
- get_host_reachable()¶
- Returns:
whether the host is reachable
- Return type:
Returns
True
if self believes that the host pointed to byCamel.NetworkService
:connectable
can be reached. This property is updated automatically as network conditions change.New in version 3.8.
- get_service_name(method)¶
- Parameters:
method (
Camel.NetworkSecurityMethod
) – aCamel.NetworkSecurityMethod
- Returns:
the network service name for self and method, or
None
- Return type:
Returns the standard network service name for self and the security method method, as defined in /etc/services. For example, the service name for unencrypted IMAP or encrypted IMAP using STARTTLS is “imap”, but the service name for IMAP over SSL is “imaps”.
New in version 3.2.
- ref_connectable()¶
- Returns:
- Return type:
Returns the socket endpoint for the network service to which self is a client.
The returned
Gio.SocketConnectable
is referenced for thread-safety and must be unreferenced withGObject.Object.unref
() when finished with it.New in version 3.8.
- set_connectable(connectable)¶
- Parameters:
connectable (
Gio.SocketConnectable
orNone
) – aGio.SocketConnectable
, orNone
Sets the socket endpoint for the network service to which self is a client. If connectable is
None
, aGio.SocketConnectable
is derived from the self'sCamel.NetworkSettings
.New in version 3.8.
- starttls(base_stream)¶
- Parameters:
base_stream (
Gio.IOStream
) – aGio.IOStream
- Raises:
- Returns:
the new
Gio.TlsClientConnection
, orNone
on error- Return type:
Gio.IOStream
orNone
Creates a
Gio.TlsClientConnection
wrapping base_stream, which is assumed to communicate with the server identified by self'sCamel.NetworkService
:connectable
.This should typically be called after issuing a STARTTLS command to a server to initiate a Transport Layer Security handshake.
New in version 3.12.
- do_connect_sync(cancellable) virtual¶
- Parameters:
cancellable (
Gio.Cancellable
orNone
) – optionalGio.Cancellable
object, orNone
- Returns:
a
Gio.IOStream
, orNone
on error- Return type:
Attempts to establish a network connection to the server described by service, using the preferred
Camel.NetworkSettings
:security-method
to secure the connection. If a connection cannot be established, or the connection attempt is cancelled, the function sets error and returnsNone
.New in version 3.2.
- do_get_default_port(method) virtual¶
- Parameters:
method (
Camel.NetworkSecurityMethod
) – aCamel.NetworkSecurityMethod
- Returns:
the default port number for service and method
- Return type:
Returns the default network port number for service and the security method method, as defined in /etc/services. For example, the default port for unencrypted IMAP or encrypted IMAP using STARTTLS is 143, but the default port for IMAP over SSL is 993.
New in version 3.2.
- do_get_service_name(method) virtual¶
- Parameters:
method (
Camel.NetworkSecurityMethod
) – aCamel.NetworkSecurityMethod
- Returns:
the network service name for service and method, or
None
- Return type:
Returns the standard network service name for service and the security method method, as defined in /etc/services. For example, the service name for unencrypted IMAP or encrypted IMAP using STARTTLS is “imap”, but the service name for IMAP over SSL is “imaps”.
New in version 3.2.
Property Details¶
- Camel.NetworkService.props.connectable¶
- Name:
connectable
- Type:
- Default Value:
- Flags:
Socket endpoint of a network service