Infinity.XmlConnection

g GObject.GInterface GObject.GInterface Infinity.XmlConnection Infinity.XmlConnection GObject.GInterface->Infinity.XmlConnection

Implementations:

Infinity.SimulatedConnection, Infinity.XmppConnection

Methods

close ()

error (error)

open ()

received (xml)

send (xml)

sent (xml)

Virtual Methods

do_close ()

do_error (error)

do_open ()

do_received (xml)

do_send (xml)

do_sent (xml)

Properties

Name

Type

Flags

Short Description

local-certificate

int

r

The X.509 certificate (InfGnutls.X509Crt) of the local site

local-id

str

r

A unique identification on the network for the local site

network

str

r

An identifier for the type of network this connection is on

remote-certificate

Infinity.CertificateChain

r

The X.509 certificate of the remote site

remote-id

str

r

A unique identification on the network for the remote site

status

Infinity.XmlConnectionStatus

r

The status of the connection.

Signals

Name

Short Description

error

This signal is emitted when an error occurs for this connection.

received

Signal which is emitted when an XML node has been received by this connection.

sent

Signal which is emitted when an XML node has been successfully transmitted with this connection.

Fields

None

Class Details

class Infinity.XmlConnection
Bases:

GObject.GInterface

Structure:

Infinity.XmlConnectionInterface

Infinity.XmlConnection is an opaque data type. You should only access it via the public API functions.

close()

Closes the given connection.

error(error)
Parameters:

error (GLib.Error) – The error that occurred.

Emits the “error” signal on self. This will most likely only be useful to implementors.

Note that the error may or may not be fatal for the connection. If it is fatal, then a status notify to Infinity.XmlConnectionStatus.CLOSING or Infinity.XmlConnectionStatus.CLOSED will follow. If you are implementing a custom class implementing Infinity.XmlConnection, make sure to always emit the “error” signal before doing the status notify because many users of the connection will release their reference when the connection is no longer connected.

open()
Raises:

GLib.Error

Returns:

True on succes, or False on error.

Return type:

bool

Attempts to open the given XML connection. If the process fails, error will be set. The connection needs to be in status Infinity.XmlConnectionStatus.CLOSED for this function to be called. Even if this function succeeds, the connection process can fail later. In that case the status of self will be reset to Infinity.XmlConnectionStatus.CLOSED and the Infinity.XmlConnection ::error signal will be emitted.

received(xml)
Parameters:

xml (libxml2.NodePtr) – The XML message that has been received.

Emits the “received” signal on self. This will most likely only be useful to implementors.

send(xml)
Parameters:

xml (libxml2.NodePtr) – A XML message to send. The function takes ownership of the XML node.

Sends the given XML message to the remote host.

sent(xml)
Parameters:

xml (libxml2.NodePtr) – The XML message that has been sent.

Emits the “sent” signal on self. This will most likely only be useful to implementors.

do_close() virtual

Closes the given connection.

do_error(error) virtual
Parameters:

error (GLib.Error) – The error that occurred.

Emits the “error” signal on connection. This will most likely only be useful to implementors.

Note that the error may or may not be fatal for the connection. If it is fatal, then a status notify to Infinity.XmlConnectionStatus.CLOSING or Infinity.XmlConnectionStatus.CLOSED will follow. If you are implementing a custom class implementing Infinity.XmlConnection, make sure to always emit the “error” signal before doing the status notify because many users of the connection will release their reference when the connection is no longer connected.

do_open() virtual
Returns:

True on succes, or False on error.

Return type:

bool

Attempts to open the given XML connection. If the process fails, error will be set. The connection needs to be in status Infinity.XmlConnectionStatus.CLOSED for this function to be called. Even if this function succeeds, the connection process can fail later. In that case the status of connection will be reset to Infinity.XmlConnectionStatus.CLOSED and the Infinity.XmlConnection ::error signal will be emitted.

do_received(xml) virtual
Parameters:

xml (libxml2.NodePtr) – The XML message that has been received.

Emits the “received” signal on connection. This will most likely only be useful to implementors.

do_send(xml) virtual
Parameters:

xml (libxml2.NodePtr) – A XML message to send. The function takes ownership of the XML node.

Sends the given XML message to the remote host.

do_sent(xml) virtual
Parameters:

xml (libxml2.NodePtr) – The XML message that has been sent.

Emits the “sent” signal on connection. This will most likely only be useful to implementors.

Signal Details

Infinity.XmlConnection.signals.error(xml_connection, error)
Signal Name:

error

Flags:

RUN_LAST

Parameters:

This signal is emitted when an error occurs for this connection. For example, if the connection cannot be established and the status changes from Infinity.XmlConnectionStatus.OPENING to Infinity.XmlConnectionStatus.CLOSED, then this signal is usually emitted with more details on the error.

Note however that the error may or may not be fatal for the connection. If it is fatal, then a status notify to Infinity.XmlConnectionStatus.CLOSING or Infinity.XmlConnectionStatus.CLOSED will follow.

Infinity.XmlConnection.signals.received(xml_connection, node)
Signal Name:

received

Flags:

RUN_LAST

Parameters:

Signal which is emitted when an XML node has been received by this connection.

Infinity.XmlConnection.signals.sent(xml_connection, node)
Signal Name:

sent

Flags:

RUN_LAST

Parameters:

Signal which is emitted when an XML node has been successfully transmitted with this connection.

Property Details

Infinity.XmlConnection.props.local_certificate
Name:

local-certificate

Type:

int

Default Value:

None

Flags:

READABLE

The X.509 certificate (InfGnutls.X509Crt) of the local site

Infinity.XmlConnection.props.local_id
Name:

local-id

Type:

str

Default Value:

None

Flags:

READABLE

A unique identification on the network for the local site

Infinity.XmlConnection.props.network
Name:

network

Type:

str

Default Value:

None

Flags:

READABLE

An identifier for the type of network this connection is on

Infinity.XmlConnection.props.remote_certificate
Name:

remote-certificate

Type:

Infinity.CertificateChain

Default Value:

None

Flags:

READABLE

The X.509 certificate of the remote site

Infinity.XmlConnection.props.remote_id
Name:

remote-id

Type:

str

Default Value:

None

Flags:

READABLE

A unique identification on the network for the remote site

Infinity.XmlConnection.props.status
Name:

status

Type:

Infinity.XmlConnectionStatus

Default Value:

Infinity.XmlConnectionStatus.CLOSED

Flags:

READABLE

The status of the connection.