Article

From:
To:
Paul Breneman
Subject:
Re: Error with TApdWinsockPort
Newsgroup:
turbocontrol.apro.general

Re: Error with TApdWinsockPort

Paul,

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
 
 
Originally created by
Tamarack Associates
Thu, 28 Mar 2024 14:58:07 UTC
Copyright © 2009-2024
HREF Tools Corp.