websocketConnectAsync

open fun websocketConnectAsync(msg: Message, origin: String? = null, protocols: List<String>? = null, ioPriority: <Error class: unknown class>, cancellable: <Error class: unknown class>? = null, callback: <Error class: unknown class>?)

Asynchronously creates a class@WebsocketConnection to communicate with a remote server.

All necessary WebSocket-related headers will be added to @msg, and it will then be sent and asynchronously processed normally (including handling of redirection and HTTP authentication).

If the server returns "101 Switching Protocols", then @msg's status code and response headers will be updated, and then the WebSocket handshake will be completed. On success, method@Session.websocket_connect_finish will return a new class@WebsocketConnection. On failure it will return a #GError.

If the server returns a status other than "101 Switching Protocols", then

Parameters

msg

#SoupMessage indicating the WebSocket server to connect to

origin

origin of the connection

protocols

a null-terminated array of protocols supported

ioPriority

the I/O priority of the request

cancellable

a #GCancellable

callback

the callback to invoke