:right-sidebar: True SocketAddress =================================================================== .. currentmodule:: gi.repository.Gio .. class:: SocketAddress(**properties: ~typing.Any) :no-contents-entry: Superclasses: :class:`~gi.repository.GObject.Object` Subclasses: :class:`~gi.repository.Gio.InetSocketAddress`, :class:`~gi.repository.Gio.NativeSocketAddress`, :class:`~gi.repository.Gio.UnixSocketAddress` Implemented Interfaces: :class:`~gi.repository.Gio.SocketConnectable` :Constructors: :: SocketAddress(**properties) new_from_native(native, len:int) -> Gio.SocketAddress Constructors ------------ .. rst-class:: interim-class .. class:: SocketAddress :no-index: .. classmethod:: new_from_native(native: None, len: int) -> ~gi.repository.Gio.SocketAddress Creates a :obj:`~gi.repository.Gio.SocketAddress` subclass corresponding to the native struct sockaddr ``native``. .. versionadded:: 2.22 :param native: a pointer to a struct sockaddr :param len: the size of the memory location pointed to by ``native`` Methods ------- .. rst-class:: interim-class .. class:: SocketAddress :no-index: .. method:: get_family() -> ~gi.repository.Gio.SocketFamily Gets the socket family type of ``address``. .. versionadded:: 2.22 .. method:: get_native_size() -> int Gets the size of ``address``'s native struct sockaddr. You can use this to allocate memory to pass to :func:`~gi.repository.Gio.SocketAddress.to_native`. .. versionadded:: 2.22 .. method:: to_native(dest: None, destlen: int) -> bool Converts a :obj:`~gi.repository.Gio.SocketAddress` to a native struct sockaddr, which can be passed to low-level functions like connect() or bind(). If not enough space is available, a :const:`~gi.repository.Gio.IOErrorEnum.NO_SPACE` error is returned. If the address type is not known on the system then a :const:`~gi.repository.Gio.IOErrorEnum.NOT_SUPPORTED` error is returned. .. versionadded:: 2.22 :param dest: a pointer to a memory location that will contain the native struct sockaddr :param destlen: the size of ``dest``. Must be at least as large as :func:`~gi.repository.Gio.SocketAddress.get_native_size` Properties ---------- .. rst-class:: interim-class .. class:: SocketAddress :no-index: .. attribute:: props.family :type: ~gi.repository.Gio.SocketFamily The family of the socket address. .. versionadded:: 2.22 Virtual Methods --------------- .. rst-class:: interim-class .. class:: SocketAddress :no-index: .. method:: do_get_family() -> ~gi.repository.Gio.SocketFamily Gets the socket family type of ``address``. .. versionadded:: 2.22 .. method:: do_get_native_size() -> int Gets the size of ``address``'s native struct sockaddr. You can use this to allocate memory to pass to :func:`~gi.repository.Gio.SocketAddress.to_native`. .. versionadded:: 2.22 .. method:: do_to_native(dest: None, destlen: int) -> bool Converts a :obj:`~gi.repository.Gio.SocketAddress` to a native struct sockaddr, which can be passed to low-level functions like connect() or bind(). If not enough space is available, a :const:`~gi.repository.Gio.IOErrorEnum.NO_SPACE` error is returned. If the address type is not known on the system then a :const:`~gi.repository.Gio.IOErrorEnum.NOT_SUPPORTED` error is returned. .. versionadded:: 2.22 :param dest: a pointer to a memory location that will contain the native struct sockaddr :param destlen: the size of ``dest``. Must be at least as large as :func:`~gi.repository.Gio.SocketAddress.get_native_size` Fields ------ .. rst-class:: interim-class .. class:: SocketAddress :no-index: .. attribute:: parent_instance