Table of Contents

Interface IRealtimeSocket

Namespace
Supabase.Realtime.Interfaces
Assembly
Supabase.Realtime.dll

Contract for a realtime socket.

public interface IRealtimeSocket : IGettableHeaders
Inherited Members

Properties

IsConnected

Is this socket connected?

bool IsConnected { get; }

Property Value

bool

Methods

AddErrorHandler(ErrorEventHandler)

Add an error handler

void AddErrorHandler(IRealtimeSocket.ErrorEventHandler handler)

Parameters

handler IRealtimeSocket.ErrorEventHandler

AddHeartbeatHandler(HeartbeatEventHandler)

Add a heartbeat handler.

void AddHeartbeatHandler(IRealtimeSocket.HeartbeatEventHandler handler)

Parameters

handler IRealtimeSocket.HeartbeatEventHandler

AddMessageReceivedHandler(MessageEventHandler)

Add a message received handler.

void AddMessageReceivedHandler(IRealtimeSocket.MessageEventHandler handler)

Parameters

handler IRealtimeSocket.MessageEventHandler

AddStateChangedHandler(StateEventHandler)

Add a state changed handler.

void AddStateChangedHandler(IRealtimeSocket.StateEventHandler handler)

Parameters

handler IRealtimeSocket.StateEventHandler

ClearErrorHandlers()

Clear error handlers.

void ClearErrorHandlers()

ClearHeartbeatHandlers()

Clear heartbeat handlers.

void ClearHeartbeatHandlers()

ClearMessageReceivedHandlers()

Clear message received handlers.

void ClearMessageReceivedHandlers()

ClearStateChangedHandlers()

Clear state changed handlers.

void ClearStateChangedHandlers()

Connect()

Connects to a socket

Task Connect()

Returns

Task

Disconnect(WebSocketCloseStatus, string)

Disconnects from a socket

void Disconnect(WebSocketCloseStatus code = WebSocketCloseStatus.NormalClosure, string reason = "")

Parameters

code WebSocketCloseStatus
reason string

GetLatency()

Gets the roundtrip time of a single message between client and server.

Task<double> GetLatency()

Returns

Task<double>

MakeMsgRef()

Generates a Message ref, used in Push(SocketRequest)

string MakeMsgRef()

Returns

string

Push(SocketRequest)

void Push(SocketRequest data)

Parameters

data SocketRequest

RemoveErrorHandler(ErrorEventHandler)

Remove an error handler

void RemoveErrorHandler(IRealtimeSocket.ErrorEventHandler handler)

Parameters

handler IRealtimeSocket.ErrorEventHandler

RemoveHeartbeatHandler(HeartbeatEventHandler)

Remove heartbeat handler.

void RemoveHeartbeatHandler(IRealtimeSocket.HeartbeatEventHandler handler)

Parameters

handler IRealtimeSocket.HeartbeatEventHandler

RemoveMessageReceivedHandler(MessageEventHandler)

Remove a message received handler.

void RemoveMessageReceivedHandler(IRealtimeSocket.MessageEventHandler handler)

Parameters

handler IRealtimeSocket.MessageEventHandler

RemoveStateChangedHandler(StateEventHandler)

Remove a state changed handler.

void RemoveStateChangedHandler(IRealtimeSocket.StateEventHandler handler)

Parameters

handler IRealtimeSocket.StateEventHandler