event


Description:

[ Version ( since = "2.32" ) ]
public virtual signal void event (SocketClientEvent event, SocketConnectable connectable, IOStream? connection)

Emitted when client's activity on connectable changes state.

Among other things, this can be used to provide progress information about a network connection in the UI. The meanings of the different event values are as follows:

  • g_socket_client_resolving: client is about to look up connectable in DNS. connection will be null.
  • g_socket_client_resolved: client has successfully resolved connectable in DNS. connection will be null.
  • g_socket_client_connecting: client is about to make a connection to a remote host; either a proxy server or the destination server itself. connection is the SocketConnection, which is not yet connected. Since GLib 2.40, you can access the remote address via get_remote_address.
  • g_socket_client_connected: client has successfully connected to a remote host. connection is the connected SocketConnection.
  • g_socket_client_proxy_negotiating: client is about to negotiate with a proxy to get it to connect to connectable. connection is the SocketConnection to the proxy server.
  • g_socket_client_proxy_negotiated: client has negotiated a connection to connectable through a proxy server. connection is the stream returned from connect, which may or may not be a SocketConnection.
  • g_socket_client_tls_handshaking: client is about to begin a TLS handshake. connection is a TlsClientConnection.
  • g_socket_client_tls_handshaked: client has successfully completed the TLS handshake. connection is a TlsClientConnection.
  • g_socket_client_complete: client has either successfully connected to connectable (in which case connection is the SocketConnection that it will be returning to the caller) or has failed (in which case connection is null and the client is about to return an error).

Each event except g_socket_client_complete may be emitted multiple times (or not at all) for a given connectable (in particular, if client ends up attempting to connect to more than one address). However, if client emits the event signal at all for a given connectable, then it will always emit it with g_socket_client_complete when it is done.

Note that there may be additional SocketClientEvent values in the future; unrecognized event values should be ignored.

Parameters:

event

the event that is occurring

connectable

the SocketConnectable that event is occurring on

connection

the current representation of the connection