Gio.InetSocketAddress

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.InetSocketAddress Gio.InetSocketAddress Gio.SocketAddress->Gio.InetSocketAddress Gio.SocketConnectable->Gio.SocketAddress

Subclasses:

Gio.ProxyAddress

Methods

Inherited:

Gio.SocketAddress (4), GObject.Object (37), Gio.SocketConnectable (3)

Structs:

GObject.ObjectClass (5)

class

new (address, port)

class

new_from_string (address, port)

get_address ()

get_flowinfo ()

get_port ()

get_scope_id ()

Virtual Methods

Inherited:

Gio.SocketAddress (3), GObject.Object (7), Gio.SocketConnectable (3)

Properties

Inherited:

Gio.SocketAddress (1)

Name

Type

Flags

Short Description

address

Gio.InetAddress

r/w/co

flowinfo

int

r/w/co

port

int

r/w/co

scope-id

int

r/w/co

Signals

Inherited:

GObject.Object (1)

Fields

Inherited:

GObject.Object (1)

Name

Type

Access

Description

parent_instance

Gio.SocketAddress

r

Class Details

class Gio.InetSocketAddress(**kwargs)
Bases:

Gio.SocketAddress

Abstract:

No

Structure:

Gio.InetSocketAddressClass

An IPv4 or IPv6 socket address. That is, the combination of a [class`Gio`.InetAddress] and a port number.

In UNIX terms, GInetSocketAddress corresponds to a struct sockaddr_in or struct sockaddr_in6).

classmethod new(address, port)[source]
Parameters:
Returns:

a new Gio.InetSocketAddress

Return type:

Gio.SocketAddress

Creates a new Gio.InetSocketAddress for address and port.

New in version 2.22.

classmethod new_from_string(address, port)[source]
Parameters:
  • address (str) – the string form of an IP address

  • port (int) – a port number

Returns:

a new Gio.InetSocketAddress, or None if address cannot be parsed.

Return type:

Gio.SocketAddress or None

Creates a new Gio.InetSocketAddress for address and port.

If address is an IPv6 address, it can also contain a scope ID (separated from the address by a %).

New in version 2.40.

get_address()[source]
Returns:

the Gio.InetAddress for self, which must be GObject.Object.ref()’d if it will be stored

Return type:

Gio.InetAddress

Gets self's Gio.InetAddress.

New in version 2.22.

get_flowinfo()[source]
Returns:

the flowinfo field

Return type:

int

Gets the sin6_flowinfo field from self, which must be an IPv6 address.

New in version 2.32.

get_port()[source]
Returns:

the port for self

Return type:

int

Gets self's port.

New in version 2.22.

get_scope_id()[source]
Returns:

the scope id field

Return type:

int

Gets the sin6_scope_id field from self, which must be an IPv6 address.

New in version 2.32.

Property Details

Gio.InetSocketAddress.props.address
Name:

address

Type:

Gio.InetAddress

Default Value:

None

Flags:

READABLE, WRITABLE, CONSTRUCT_ONLY

The address.

New in version 2.22.

Gio.InetSocketAddress.props.flowinfo
Name:

flowinfo

Type:

int

Default Value:

0

Flags:

READABLE, WRITABLE, CONSTRUCT_ONLY

The sin6_flowinfo field, for IPv6 addresses.

New in version 2.32.

Gio.InetSocketAddress.props.port
Name:

port

Type:

int

Default Value:

0

Flags:

READABLE, WRITABLE, CONSTRUCT_ONLY

The port.

New in version 2.22.

Gio.InetSocketAddress.props.scope_id
Name:

scope-id

Type:

int

Default Value:

0

Flags:

READABLE, WRITABLE, CONSTRUCT_ONLY

The sin6_scope_id field, for IPv6 addresses.

New in version 2.32.