Gio.NetworkService

g GObject.GInterface GObject.GInterface Gio.SocketConnectable Gio.SocketConnectable GObject.GInterface->Gio.SocketConnectable GObject.Object GObject.Object Gio.NetworkService Gio.NetworkService GObject.Object->Gio.NetworkService Gio.SocketConnectable->Gio.NetworkService

Subclasses:

None

Methods

Inherited:

GObject.Object (37), Gio.SocketConnectable (3)

Structs:

GObject.ObjectClass (5)

class

new (service, protocol, domain)

get_domain ()

get_protocol ()

get_scheme ()

get_service ()

set_scheme (scheme)

Virtual Methods

Inherited:

GObject.Object (7), Gio.SocketConnectable (3)

Properties

Name

Type

Flags

Short Description

domain

str

r/w/co

Network domain, eg, “example.com”

protocol

str

r/w/co

Network protocol, eg “tcp”

scheme

str

r/w

Network scheme (default is to use service)

service

str

r/w/co

Service name, eg “ldap”

Signals

Inherited:

GObject.Object (1)

Fields

Inherited:

GObject.Object (1)

Name

Type

Access

Description

parent_instance

GObject.Object

r

Class Details

class Gio.NetworkService(**kwargs)
Bases:

GObject.Object, Gio.SocketConnectable

Abstract:

No

Structure:

Gio.NetworkServiceClass

Like Gio.NetworkAddress does with hostnames, Gio.NetworkService provides an easy way to resolve a SRV record, and then attempt to connect to one of the hosts that implements that service, handling service priority/weighting, multiple IP addresses, and multiple address families.

See Gio.SrvTarget for more information about SRV records, and see Gio.SocketConnectable for an example of using the connectable interface.

classmethod new(service, protocol, domain)[source]
Parameters:
  • service (str) – the service type to look up (eg, “ldap”)

  • protocol (str) – the networking protocol to use for service (eg, “tcp”)

  • domain (str) – the DNS domain to look up the service in

Returns:

a new Gio.NetworkService

Return type:

Gio.NetworkService

Creates a new Gio.NetworkService representing the given service, protocol, and domain. This will initially be unresolved; use the Gio.SocketConnectable interface to resolve it.

New in version 2.22.

get_domain()[source]
Returns:

self's domain name

Return type:

str

Gets the domain that self serves. This might be either UTF-8 or ASCII-encoded, depending on what self was created with.

New in version 2.22.

get_protocol()[source]
Returns:

self's protocol name

Return type:

str

Gets self's protocol name (eg, “tcp”).

New in version 2.22.

get_scheme()[source]
Returns:

self's scheme name

Return type:

str

Gets the URI scheme used to resolve proxies. By default, the service name is used as scheme.

New in version 2.26.

get_service()[source]
Returns:

self's service name

Return type:

str

Gets self's service name (eg, “ldap”).

New in version 2.22.

set_scheme(scheme)[source]
Parameters:

scheme (str) – a URI scheme

Set’s the URI scheme used to resolve proxies. By default, the service name is used as scheme.

New in version 2.26.

Property Details

Gio.NetworkService.props.domain
Name:

domain

Type:

str

Default Value:

None

Flags:

READABLE, WRITABLE, CONSTRUCT_ONLY

Network domain, eg, “example.com”

Gio.NetworkService.props.protocol
Name:

protocol

Type:

str

Default Value:

None

Flags:

READABLE, WRITABLE, CONSTRUCT_ONLY

Network protocol, eg “tcp”

Gio.NetworkService.props.scheme
Name:

scheme

Type:

str

Default Value:

None

Flags:

READABLE, WRITABLE

Network scheme (default is to use service)

Gio.NetworkService.props.service
Name:

service

Type:

str

Default Value:

None

Flags:

READABLE, WRITABLE, CONSTRUCT_ONLY

Service name, eg “ldap”