Hello Larini, for winsock it will end up probably the same, but in (2) you are 80 times re-allocating memory and probably copying bytes several times.
if you really dont can create the send buffer at once you can do this: for a := 0 to 80 do Socket.PutStringInSendBuffer(MyString); Socket.Send(nil, 0); --- Rgds, Wilfried [TeamICS] http://www.overbyte.be/eng/overbyte/teamics.html http://www.mestdagh.biz Tuesday, November 1, 2005, 09:54, 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? > 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