Gio.SocketClient::event
connect('event', function (socketClient, event: Gio.SocketClientEvent, connectable: Gio.SocketConnectable, connection: Gio.IOStream, ): void);
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:
- Gio.SocketClientEvent.resolving: @client is about to look up connectable in DNS. connection will be null.
- Gio.SocketClientEvent.resolved: @client has successfully resolved connectable in DNS. connection will be null.
- Gio.SocketClientEvent.connecting: @client is about to make a connection to a remote host; either a proxy server or the destination server itself. connection is the Gio.SocketConnection, which is not yet connected. Since GLib 2.40, you can access the remote address via Gio.SocketConnection.prototype.get_remote_address.
- Gio.SocketClientEvent.connected: @client has successfully connected to a remote host. connection is the connected Gio.SocketConnection.
- Gio.SocketClientEvent.proxy_negotiating: @client is about to negotiate with a proxy to get it to connect to connectable. connection is the Gio.SocketConnection to the proxy server.
- Gio.SocketClientEvent.proxy_negotiated: @client has negotiated a connection to connectable through a proxy server. connection is the stream returned from Gio.Proxy.prototype.connect, which may or may not be a Gio.SocketConnection.
- Gio.SocketClientEvent.tls_handshaking: @client is about to begin a TLS handshake. connection is a Gio.TlsClientConnection.
- Gio.SocketClientEvent.tls_handshaked: @client has successfully completed the TLS handshake. connection is a Gio.TlsClientConnection.
- Gio.SocketClientEvent.complete: @client has either successfully connected to connectable (in which case connection is the Gio.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 Gio.SocketClientEvent.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 Gio.SocketClient::event signal at all for a given connectable, that it will always emit it with Gio.SocketClientEvent.complete when it is done.
Note that there may be additional Gio.SocketClientEvent values in the future; unrecognized event values should be ignored.
Since 2.32
- socketClient
instance of Gio.SocketClient that is emitting the signal
- event
the event that is occurring
- connectable
the Gio.SocketConnectable that event is occurring on
- connection
the current representation of the connection