:right-sidebar: True NetworkService =================================================================== .. currentmodule:: gi.repository.Gio .. class:: NetworkService(**properties: ~typing.Any) :no-contents-entry: Superclasses: :class:`~gi.repository.GObject.Object` Implemented Interfaces: :class:`~gi.repository.Gio.SocketConnectable` Like :obj:`~gi.repository.Gio.NetworkAddress` does with hostnames, ``GNetworkService`` 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 :obj:`~gi.repository.Gio.SrvTarget` for more information about SRV records, and see :obj:`~gi.repository.Gio.SocketConnectable` for an example of using the connectable interface. Constructors ------------ .. rst-class:: interim-class .. class:: NetworkService :no-index: .. classmethod:: new(service: str, protocol: str, domain: str) -> ~gi.repository.Gio.NetworkService Creates a new :obj:`~gi.repository.Gio.NetworkService` representing the given ``service``\, ``protocol``\, and ``domain``\. This will initially be unresolved; use the :obj:`~gi.repository.Gio.SocketConnectable` interface to resolve it. .. versionadded:: 2.22 :param service: the service type to look up (eg, "ldap") :param protocol: the networking protocol to use for ``service`` (eg, "tcp") :param domain: the DNS domain to look up the service in Methods ------- .. rst-class:: interim-class .. class:: NetworkService :no-index: .. method:: get_domain() -> str Gets the domain that ``srv`` serves. This might be either UTF-8 or ASCII-encoded, depending on what ``srv`` was created with. .. versionadded:: 2.22 .. method:: get_protocol() -> str Gets ``srv``\'s protocol name (eg, "tcp"). .. versionadded:: 2.22 .. method:: get_scheme() -> str Gets the URI scheme used to resolve proxies. By default, the service name is used as scheme. .. versionadded:: 2.26 .. method:: get_service() -> str Gets ``srv``\'s service name (eg, "ldap"). .. versionadded:: 2.22 .. method:: set_scheme(scheme: str) -> None Set's the URI scheme used to resolve proxies. By default, the service name is used as scheme. .. versionadded:: 2.26 :param scheme: a URI scheme Properties ---------- .. rst-class:: interim-class .. class:: NetworkService :no-index: .. attribute:: props.domain :type: str The type of the None singleton. .. versionadded:: 2.22 .. attribute:: props.protocol :type: str The type of the None singleton. .. versionadded:: 2.22 .. attribute:: props.scheme :type: str The type of the None singleton. .. versionadded:: 2.22 .. attribute:: props.service :type: str The type of the None singleton. .. versionadded:: 2.22 Fields ------ .. rst-class:: interim-class .. class:: NetworkService :no-index: .. attribute:: parent_instance .. attribute:: priv