TsgcRTCPeerConnectionEvents › OnRTCWebSocketRemoteDisconnect

OnRTCWebSocketRemoteDisconnect Event

Fired when the remote peer requests a disconnect via signalling.

Syntax

property OnRTCWebSocketRemoteDisconnect: TsgcRTCWebSocketRemoteDisconnectEvent;
// TsgcRTCWebSocketRemoteDisconnectEvent = procedure(Sender: TObject; Connection: TsgcWSConnection; var aDisconnect: Boolean) of object

Default Value

Remarks

Raised when the remote peer sends a RTCPeerConnection-subprotocol disconnect message through the signalling WebSocket. Set aDisconnect to False to ignore the request and keep the session alive (for example to attempt an ICE restart); leave it True to let the component tear down the state. Use it as a hook to log the event or to decide whether a reconnection should be attempted.

Example

procedure TForm1.oRTCWebSocketRemoteDisconnect(Sender: TObject;
  Connection: TsgcWSConnection; var aDisconnect: Boolean);
begin
  Log('Remote peer requested disconnect');
  aDisconnect := True;
end;

Back to Events