I would add that PutStringInSendBuffer and PutDataInSendBuffer are very useful when you have small data chunks that you want to send in a bigger one. That is make as possible as sure that the packets have maximum size.
for a:=0 to 80 do Socket.PutStringInSendBuffer(MyString); Socket.Send(nil, 0); // Will force the socket to try to send his buffer Contribute to the SSL Effort. Visit http://www.overbyte.be/eng/ssl.html -- [EMAIL PROTECTED] The author for the freeware multi-tier middleware MidWare The author of the freeware Internet Component Suite (ICS) http://www.overbyte.be ----- Original Message ----- From: "Arno Garrels" <[EMAIL PROTECTED]> To: "ICS support mailing" <email@example.com> Sent: Tuesday, November 01, 2005 12:24 PM Subject: Re: [twsocket] Send one big or a lot of small strings > Larini wrote: >> Hi, I want to know if there are a difference between the two codes >> bellow: >> >> MyString = 100 bytes >> >> 1. >> For a:=0 to 80 do >> socket.SendStr(MyString); >> >> >> 2. >> For a:=0 to 80 do >> aux:=aux+MyStr; >> socket.SendStr(aux); >> >> >> The first one, sends about 8000 bytes using 80 sendstr commands >> The second send about 8000 bytes using only one command. >> >> There are difference or in the first one will send all together too? > > You should understand how Send is working in ICS. > ICS has an internal send buffer. Send() as well as SendStr() > put data into that buffer first before it is real-sent. > The real-send may send it in chunks anyway. > >>From the view of a receiver both of your methods make no difference. > > However both are not suggested. There is an event OnDataSent that > should be used to send large amount of data. > You could send the first string and any remaining strings in > OnDataSent. > > --- > Arno Garrels [TeamICS] > > > >> >> Thanks. >> >> ________________________________________________ >> This mail was sent >> by Webmail 2.5 > -- > 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