preconnectAsync

open fun preconnectAsync(msg: Message, ioPriority: <Error class: unknown class>, cancellable: <Error class: unknown class>? = null, callback: <Error class: unknown class>?)

Start a preconnection to @msg.

Once the connection is done, it will remain in idle state so that it can be reused by future requests. If there's already an idle connection for the given @msg host, the operation finishes successfully without creating a new connection. If a new request for the given @msg host is made while the preconnect is still ongoing, the request will take the ownership of the connection and the preconnect operation will finish successfully (if there's a connection error it will be handled by the request).

The operation finishes when the connection is done or an error occurred.

Parameters

msg

a #SoupMessage

ioPriority

the I/O priority of the request

cancellable

a #GCancellable

callback

the callback to invoke when the operation finishes