Page 1 of 1

Error sending massive commands

Posted: Wed Aug 12, 2015 8:05 pm
by friman
I am trying send massive commands to allowed guids, executing the follow sentences

Code: Select all

Cmd := TRVCmd.Create;
  Cmd.Cmd := _CMD_USER_STATUS;
  with Cmd.Params.Add  do begin
    Name      := 'Status';
    ParamType := rvptString;
    Value     := Status;
  end;

  for I := 0 to Length(AllUsers)-1 do begin
     RVCamSender1.SendCmd(Cmd, AllUsers[i].GUID, '');
     RVCamSender1.WaitForSendCmd;
  end;
The first normal, the second return error. Is there some suitable way to do that?

Posted: Thu Aug 13, 2015 1:33 pm
by Sergey Tkachenko
SendCmd frees TRVCmd object, so you cannot use the same object for sending multiple commands.
Create a new TRVCmd object for each call of SendCmd