:right-sidebar: True SrvTarget =================================================================== .. currentmodule:: gi.repository.Gio .. class:: SrvTarget(**kwargs) :no-contents-entry: :Constructors: :: new(hostname:str, port:int, priority:int, weight:int) -> Gio.SrvTarget Constructors ------------ .. rst-class:: interim-class .. class:: SrvTarget :no-index: .. classmethod:: new(hostname: str, port: int, priority: int, weight: int) -> ~gi.repository.Gio.SrvTarget Creates a new :obj:`~gi.repository.Gio.SrvTarget` with the given parameters. You should not need to use this; normally :obj:`~gi.repository.Gio.SrvTarget` are created by :obj:`~gi.repository.Gio.Resolver`. .. versionadded:: 2.22 :param hostname: the host that the service is running on :param port: the port that the service is running on :param priority: the target's priority :param weight: the target's weight Methods ------- .. rst-class:: interim-class .. class:: SrvTarget :no-index: .. method:: free() -> None Frees ``target`` .. versionadded:: 2.22 .. method:: get_hostname() -> str Gets ``target``'s hostname (in ASCII form; if you are going to present this to the user, you should use :func:`~gi.repository.GLib.hostname_is_ascii_encoded` to check if it contains encoded Unicode segments, and use :func:`~gi.repository.GLib.hostname_to_unicode` to convert it if it does.) .. versionadded:: 2.22 .. method:: get_port() -> int Gets ``target``'s port .. versionadded:: 2.22 .. method:: get_priority() -> int Gets ``target``'s priority. You should not need to look at this; :obj:`~gi.repository.Gio.Resolver` already sorts the targets according to the algorithm in RFC 2782. .. versionadded:: 2.22 .. method:: get_weight() -> int Gets ``target``'s weight. You should not need to look at this; :obj:`~gi.repository.Gio.Resolver` already sorts the targets according to the algorithm in RFC 2782. .. versionadded:: 2.22