api

http4k / org.http4k.client / WebsocketClient

WebsocketClient

object WebsocketClient

Functions

Name Summary
blocking Provides a client-side WsClient connected to a remote Websocket. This is a blocking API, so accessing the sequence of “received” messages will block on iteration until all messages are received (or the socket it closed). This call will also block while connection happens.fun blocking(uri: Uri, headers: Headers = emptyList(), timeout: Duration = ZERO, autoReconnection: Boolean = false, draft: Draft = Draft_6455()): WsClient
nonBlocking Provides a client-side Websocket instance connected to a remote Websocket. The resultant object can be have listeners attached to it. Optionally pass a WsConsumer which will be called onConnectfun nonBlocking(uri: Uri, headers: Headers = emptyList(), timeout: Duration = ZERO, onError: (Throwable) -> Unit = {}, draft: Draft = Draft_6455(), onConnect: WsConsumer = {}): Websocket