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:
Added in version 3.2.
- can_reach(cancellable, callback, *user_data)¶
- Parameters:
cancellable (
Gio.CancellableorNone) – optionalGio.Cancellableobject, orNonecallback (
Gio.AsyncReadyCallbackorNone) – aGio.AsyncReadyCallbackto call when the request is satisfieduser_data (
objectorNone) – data to pass to the callback function
Asynchronously attempts to determine whether or not the host described by self's
Camel.NetworkService:connectableproperty 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.Added 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().Added in version 3.12.
- can_reach_sync(cancellable)¶
- Parameters:
cancellable (
Gio.CancellableorNone) – optionalGio.Cancellableobject, 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:connectableproperty 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 returnsFalseand sets error to an appropriate error (such asGio.IOErrorEnum.HOST_UNREACHABLE).The function will also update the self's
Camel.NetworkService:host-reachableproperty based on the result.Added in version 3.12.
- connect_sync(cancellable)¶
- Parameters:
cancellable (
Gio.CancellableorNone) – optionalGio.Cancellableobject, orNone- Raises:
- Returns:
a
Gio.IOStream, orNoneon error- Return type:
Attempts to establish a network connection to the server described by self, using the preferred
Camel.NetworkSettings:security-methodto secure the connection. If a connection cannot be established, or the connection attempt is cancelled, the function sets error and returnsNone.Added 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.
Added in version 3.2.
- get_host_reachable()¶
- Returns:
whether the host is reachable
- Return type:
Returns
Trueif self believes that the host pointed to byCamel.NetworkService:connectablecan be reached. This property is updated automatically as network conditions change.Added 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”.
Added 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.SocketConnectableis referenced for thread-safety and must be unreferenced withGObject.Object.unref() when finished with it.Added in version 3.8.
- set_connectable(connectable)¶
- Parameters:
connectable (
Gio.SocketConnectableorNone) – aGio.SocketConnectable, orNone
Sets the socket endpoint for the network service to which self is a client. If connectable is
None, aGio.SocketConnectableis derived from the self'sCamel.NetworkSettings.Added in version 3.8.
- starttls(base_stream)¶
- Parameters:
base_stream (
Gio.IOStream) – aGio.IOStream- Raises:
- Returns:
the new
Gio.TlsClientConnection, orNoneon error- Return type:
Gio.IOStreamorNone
Creates a
Gio.TlsClientConnectionwrapping 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.
Added in version 3.12.
- do_connect_sync(cancellable) virtual¶
- Parameters:
cancellable (
Gio.CancellableorNone) – optionalGio.Cancellableobject, orNone- Returns:
a
Gio.IOStream, orNoneon error- Return type:
Attempts to establish a network connection to the server described by service, using the preferred
Camel.NetworkSettings:security-methodto secure the connection. If a connection cannot be established, or the connection attempt is cancelled, the function sets error and returnsNone.Added 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.
Added 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”.
Added in version 3.2.
Property Details¶
- Camel.NetworkService.props.connectable¶
- Name:
connectable- Type:
- Default Value:
- Flags:
Socket endpoint of a network service