Hello,

I  fixed  the  problem  but  I  don't  understand why it did as what I
changed   should   not  have  chaneg  anything,  I  only  removed  the
ReceiveStr()   loop   (as   it  is  useless  with  linemode:=true)  in
OnDataAvailable,  but  why  did  it  fix  the problem as this loop was
basically useless, now I have :

procedure TPOPOut.POPOutDataAvailable(Sender: TObject; ErrCode: Word);
begin
  StringRLine := TPOPOut(sender).ReceiveStr;
  TPOPOut(sender).POPIn.SendStr(StringRLine);
end;

Bad procedure :

procedure TPOPOut.POPOutDataAvailable(Sender: TObject; ErrCode: Word);
begin
  StringRLine := TPOPOut(sender).ReceiveStr;
  while (Length(StringRLine) > 0)
  begin
    TPOPOut(sender).POPIn.SendStr(StringRLine);
    StringRLine := TPOPOut(sender).ReceiveStr;
  end;
end;



FP> No need to loop beause ReceiveStr() will receive the complete line received
FP> so far and if more lines are available, then more OnDataAvailable events 
FP> will be triggered.

--
To unsubscribe or change your settings for TWSocket mailing list
please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket
Visit our website at http://www.overbyte.be

Reply via email to