procedure TForm1.OnDisconnect(const Conn: THttpApiWebSocketConnection;
aStatus: WEB_SOCKET_CLOSE_STATUS; aBuffer: Pointer; aBufferSize: Cardinal);
begin
if Assigned(Conn.PrivateData) then
begin
//Conn.PrivateData := nil; //compile error: E2064 Left side cannot be assigned to
PHttpApiWebSocketConnection(@Conn).PrivateData := nil;
end;
TSynLog.Add.Log(sllInfo, '% - disconnect', [Conn.Index]);
end;
Can I change it to
THttpApiWebSocketConnection = record ... property PrivateData: pointer read fPrivateData write fPrivateData; // write SetPrivateData?