Gio.SocketAddress - Classes - Gio 2.0 (original) (raw)
g GObject.GInterface GObject.GInterface Gio.SocketConnectable Gio.SocketConnectable GObject.GInterface->Gio.SocketConnectable GObject.Object GObject.Object Gio.SocketAddress Gio.SocketAddress GObject.Object->Gio.SocketAddress Gio.SocketConnectable->Gio.SocketAddress
Subclasses:
Gio.InetSocketAddress, Gio.NativeSocketAddress, Gio.UnixSocketAddress
Methods¶
Inherited:
GObject.Object (37), Gio.SocketConnectable (3)
Structs:
class | new_from_native (native, len) |
---|---|
get_family () | |
get_native_size () | |
to_native (dest, destlen) |
Virtual Methods¶
Inherited:
GObject.Object (7), Gio.SocketConnectable (3)
do_get_family () |
---|
do_get_native_size () |
do_to_native (dest, destlen) |
Properties¶
Name | Type | Flags | Short Description |
---|---|---|---|
family | Gio.SocketFamily | r |
Signals¶
Inherited:
Fields¶
Inherited:
Name | Type | Access | Description |
---|---|---|---|
parent_instance | GObject.Object | r |
Class Details¶
class Gio.SocketAddress(**kwargs)¶
Bases:
GObject.Object, Gio.SocketConnectable
Abstract:
Yes
Structure:
GSocketAddress
is the equivalent ofstruct sockaddr) and its subtypes in the BSD sockets API. This is an abstract class; use [class`Gio`.InetSocketAddress] for internet sockets, or [class`Gio`.UnixSocketAddress] for UNIX domain sockets.
classmethod new_from_native(native, len)[source]¶
Parameters:
- native (object) – a pointer to a struct sockaddr
- len (int) – the size of the memory location pointed to by native
Returns:
a new Gio.SocketAddress if native could successfully be converted, otherwise None
Return type:
Creates a Gio.SocketAddress subclass corresponding to the native struct sockaddr native.
New in version 2.22.
Returns:
the socket family type of self
Return type:
Gets the socket family type of self.
New in version 2.22.
Returns:
the size of the native struct sockaddr thatself represents
Return type:
Gets the size of self's native struct sockaddr. You can use this to allocate memory to pass toGio.SocketAddress.to_native().
New in version 2.22.
to_native(dest, destlen)[source]¶
Parameters:
- dest (object or None) – a pointer to a memory location that will contain the native struct sockaddr
- destlen (int) – the size of dest. Must be at least as large asGio.SocketAddress.get_native_size()
Raises:
Returns:
True if dest was filled in, False on error
Return type:
Converts a 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 Gio.IOErrorEnum.NO_SPACE error is returned. If the address type is not known on the system then a Gio.IOErrorEnum.NOT_SUPPORTED error is returned.
New in version 2.22.
do_get_family() virtual¶
Returns:
the socket family type of address
Return type:
Gets the socket family type of address.
New in version 2.22.
do_get_native_size() virtual¶
Returns:
the size of the native struct sockaddr thataddress represents
Return type:
Gets the size of address's native struct sockaddr. You can use this to allocate memory to pass toGio.SocketAddress.to_native().
New in version 2.22.
do_to_native(dest, destlen) virtual¶
Parameters:
- dest (object or None) – a pointer to a memory location that will contain the native struct sockaddr
- destlen (int) – the size of dest. Must be at least as large asGio.SocketAddress.get_native_size()
Returns:
True if dest was filled in, False on error
Return type:
Converts a 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 Gio.IOErrorEnum.NO_SPACE error is returned. If the address type is not known on the system then a Gio.IOErrorEnum.NOT_SUPPORTED error is returned.
New in version 2.22.
Property Details¶
Gio.SocketAddress.props.family¶
Name:
family
Type:
Default Value:
Flags:
The family of the socket address.
New in version 2.22.