Use line mode to have TWSocket assemble lines for you. Also read message thread with subject "Sending 7 kilobytes of data" and read "TCP/UDP primer" document available from support page at my website. You'll understand how TCP transmission work and how to manage your receiver to get all data.
-- Contribute to the SSL Effort. Visit http://www.overbyte.be/eng/ssl.html -- [EMAIL PROTECTED] Author of ICS (Internet Component Suite, freeware) Author of MidWare (Multi-tier framework, freeware) http://www.overbyte.be ----- Original Message ----- From: "albert drent" <[EMAIL PROTECTED]> To: <twsocket@elists.org> Sent: Wednesday, January 18, 2006 11:40 PM Subject: [twsocket] [re] databuffer is cut off > I am using ICS, the components I use are TWSocketServer and TWSocket. I try > to send a large string with > > Display(IntToStr(SendStr(Encrypt(AnswerData.CommaText) + #13#10))+'bytes > sent'); > CloseDelayed; > > The bytecount tells me that all is sent. But on the receive it is cut of... > > procedure TDM.CliSocketDataAvailable(Sender: TObject; Error: Word); > var > Len : Integer; var fn : textfile; > begin > { We use line mode, we will receive a complete line } > Len := CliSocket.Receive(@Buffer, SizeOf(Buffer) - 1); > assignfile(fn, 'd:\testen.txt'); > append(fn); > writeln(fn, IntToStr(SizeOf(buffer))+' '+IntToStr(Len)); > closefile(fn); > if Len <= 0 then > Exit; > > Buffer[Len] := #0; { Nul terminate } > ProcessCommand(StrPas(Buffer)); { Pass as string } > end; > > The buffersize is 100000 so large enough. It's all based on the sample > applications, but somehow data is cut-off if it exceeds something like 30k. > > In the source I read that it should be possible to transfer mb's of data in a > single call, but as the only option I see now is to send it in chuncks of ??? size. > > albert > -- > To unsubscribe or change your settings for TWSocket mailing list > please goto http://www.elists.org/mailman/listinfo/twsocket > Visit our website at http://www.overbyte.be -- To unsubscribe or change your settings for TWSocket mailing list please goto http://www.elists.org/mailman/listinfo/twsocket Visit our website at http://www.overbyte.be