GoldenGateBindings / com.fitbit.goldengate.bindings.remote / WebSocketTransport

WebSocketTransport

class WebSocketTransport : WebSocketListener

The native side of this class keeps a global reference to the instance on the C-side Remember to call cleanup() when it's no longer needed.

Constructors

<init>

WebSocketTransport(url: String, ignoreFailure: Boolean = false)

The native side of this class keeps a global reference to the instance on the C-side Remember to call cleanup() when it's no longer needed.

Properties

ptr

val ptr: Long

Functions

cleanup

fun cleanup(): Unit

This should be called after the RemoteShell exits.

onClosed

fun onClosed(webSocket: WebSocket?, code: Int, reason: String?): Unit

onFailure

fun onFailure(webSocket: WebSocket?, t: Throwable?, response: Response?): Unit

onMessage

fun onMessage(webSocket: WebSocket?, text: String?): Unit
fun onMessage(webSocket: WebSocket?, bytes: ByteString?): Unit

receive

fun receive(): ByteArray

returns an empty array if the websocket is closed and the remote shell should terminate.

send

fun send(data: ByteArray): Boolean