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
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
Disconnect(WebSocketCloseStatus, string)
Disconnects from a socket
void Disconnect(WebSocketCloseStatus code = WebSocketCloseStatus.NormalClosure, string reason = "")
Parameters
code
WebSocketCloseStatusreason
string
GetLatency()
Gets the roundtrip time of a single message between client and server.
Task<double> GetLatency()
Returns
MakeMsgRef()
Generates a Message ref, used in Push(SocketRequest)
string MakeMsgRef()
Returns
Push(SocketRequest)
Push a SocketRequest to the Supabase.Realtime.Socket
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