TsgcRTCPeerConnection › Events › OnRTCWebSocketRemoteDisconnect
Fired when the remote peer requests a disconnect via signalling.
property OnRTCWebSocketRemoteDisconnect: TsgcRTCWebSocketRemoteDisconnectEvent;
// TsgcRTCWebSocketRemoteDisconnectEvent = procedure(Sender: TObject; Connection: TsgcWSConnection; var aDisconnect: Boolean) of object
—
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.
procedure TForm1.oRTCWebSocketRemoteDisconnect(Sender: TObject;
Connection: TsgcWSConnection; var aDisconnect: Boolean);
begin
Log('Remote peer requested disconnect');
aDisconnect := True;
end;