Paul Breneman
Re: Error with TApdWinsockPort
Shortcut to this article
Printer Friendly

Re: Error with TApdWinsockPort


thank you for your continuous support.
This is a draft. I hope this will give you a correct view:
procedure TTransfer.TriggerAvail(CP: TObject; Count: Word); var   I: Integer;   C: Char; begin   if count > 0 then     begin       for I := 1 to Count do         begin               inc(MessIncr);               ReceiveBuf[MessIncr] := TApdWinsockPort(CP).GetChar;               If MessIncr = Awaited then                 Allprocessed := true;         end;     end; end;
procedure MySendData(Address: Longint);
begin   for I := 1 to 3 do     begin       NewTimerSecs(et,2);       TimeOut := false;       Allprocessed := false;       MessIncr := 0;       SendCommand(Address);       Repeat         Application.processmessages;         if TimerExpired(et) then           TimeOut := true;       until AllProcessed or TimeOut;      if Allprocessed then break;    end;    if Not timeOut then ProcessData(ReceiveBuf); end;
>> FCom.Putblock()
>> repeat
>>   application.processmessages;
>> until Allreceived or timeout;
>> What can I do then, to get it work correctly?
> Since you have application.processmessages in your loop, the loop
> itself should not be the problem.
> Is this loop in an AsyncPro event handler or in a routine that is
> called from an AsyncPro event handler?  The fact that the output is
> delayed by two seconds seems to indicate something like that might be
> the issue.

See above. I think, I'm doing it the correct way!?

Thanks Andreas
FYI: Phrase searches are enclosed in either single or double quotes
24-Jul 11:00 utc Operating system upgrade in process, expect some down time.
Originally created by
Sat, 21 Jul 2018 21:19:56 UTC
Copyright © 2009-2018
HREF Tools Corp.