function ReceiveStr: string;
ReceiveStr is used (mainly in OnDataAvailable if the component is set to use LineMode. It receives the next complete line which has been sent to the attached IP/port. ReceiveStr returns the whole line sent, including the delimiter characters set via LineEnd.
procedure TMySocket.MyOnDataAvailable(Sender: TObject; ErrCode: Word); var s :String; // received packet begin if ErrCode <> 0 then begin exit; end; s:=ReceiveStr; end;
- always set LineLimit