change_status
Description:
Change the status of the connection.
The allowed state transitions are:
TP_INTERNAL_CONNECTION_STATUS_NEW
→ CONNECTING- CONNECTING → CONNECTED
TP_INTERNAL_CONNECTION_STATUS_NEW
→ CONNECTED (exactly equivalent to both of the above one after the other; see below)- anything except DISCONNECTED → DISCONNECTED
Before the transition to CONNECTED, the implementation must have discovered the handle for the local user and passed it to set_self_handle.
Changing from NEW to CONNECTED is implemented by doing the transition from NEW to CONNECTING, followed by the transition from CONNECTING to CONNECTED; it's exactly equivalent to calling tp_base_connection_change_status for those two transitions one after the other.
Any other valid transition does the following, in this order:
- Update BaseConnection.status;
- If the new state is DISCONNECTED, call
tp_channel_factory_iface_close_all
on all channel factories - Emit the D-Bus StatusChanged signal;
- Call connecting, connected or disconnected as appropriate;
- Call the channel factories' status change callbacks;
- If the new state is DISCONNECTED, call the subclass' shut_down callback.
To provide more details about what happened when moving to status
DISCONNECTED due to an error, consider calling
tp_base_connection_disconnect_with_dbus_error
instead of this function.
Changed in 0.7.35: the self_handle
member of
BaseConnection was previously set to 0 at this stage. It now remains non-zero until the object is disposed.
Parameters:
this |
The connection |
status |
The new status |
reason |
The reason for the status change |