Gio.SocketAddress¶
| Subclasses: | Gio.InetSocketAddress, Gio.NativeSocketAddress, Gio.UnixSocketAddress |
|---|
Methods¶
| Inherited: | GObject.Object (37), Gio.SocketConnectable (3) |
|---|---|
| Structs: | GObject.ObjectClass (5) |
| 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 | The family of the socket address |
Signals¶
| Inherited: | GObject.Object (1) |
|---|
Class Details¶
-
class
Gio.SocketAddress(**kwargs)¶ Bases: GObject.Object,Gio.SocketConnectableAbstract: Yes Structure: Gio.SocketAddressClassGio.SocketAddressis the equivalent of struct sockaddr in the BSD sockets API. This is an abstract class; useGio.InetSocketAddressfor internet sockets, orGio.UnixSocketAddressfor UNIX domain sockets.-
classmethod
new_from_native(native, len)[source]¶ Parameters: Returns: a new
Gio.SocketAddressif native could successfully be converted, otherwiseNoneReturn type: Creates a
Gio.SocketAddresssubclass corresponding to the native struct sockaddr native.New in version 2.22.
-
get_family()[source]¶ Returns: the socket family type of self Return type: Gio.SocketFamilyGets the socket family type of self.
New in version 2.22.
-
get_native_size()[source]¶ Returns: the size of the native struct sockaddr that self represents Return type: intGets the size of self’s native struct sockaddr. You can use this to allocate memory to pass to
Gio.SocketAddress.to_native().New in version 2.22.
-
to_native(dest, destlen)[source]¶ Parameters: - dest (
objectorNone) – 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: Return type: Converts a
Gio.SocketAddressto 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_SPACEerror is returned. If the address type is not known on the system then aGio.IOErrorEnum.NOT_SUPPORTEDerror is returned.New in version 2.22.
- dest (
-
do_get_family() virtual¶ Returns: the socket family type of address Return type: Gio.SocketFamilyGets the socket family type of address.
New in version 2.22.
-
do_get_native_size() virtual¶ Returns: the size of the native struct sockaddr that address represents Return type: intGets the size of address’s native struct sockaddr. You can use this to allocate memory to pass to
Gio.SocketAddress.to_native().New in version 2.22.
-
do_to_native(dest, destlen) virtual¶ Parameters: - dest (
objectorNone) – 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: Return type: Converts a
Gio.SocketAddressto 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_SPACEerror is returned. If the address type is not known on the system then aGio.IOErrorEnum.NOT_SUPPORTEDerror is returned.New in version 2.22.
- dest (
-
classmethod
Property Details¶
-
Gio.SocketAddress.props.family¶ Name: familyType: Gio.SocketFamilyDefault Value: Gio.SocketFamily.INVALIDFlags: READABLEThe family of the socket address