Then use Shutdown(2); Easy to do a testcase for Eric I think. His proposition to use Close() is not good, CloseDelayed should give a little better but not on a LAN.
-- mvg, Wilfried http://www.mestdagh.biz http://www.comfortsoftware.be http://www.expertsoftware.be > -----Oorspronkelijk bericht----- > Van: twsocket-boun...@elists.org [mailto:twsocket-boun...@elists.org] > Namens Arno Garrels > Verzonden: maandag 1 augustus 2011 16:57 > Aan: ICS support mailing > Onderwerp: Re: [twsocket] Socket flushing > > Wilfried Mestdagh wrote: > > Hi Eric, > > > >> Socket.Send(@Data[0], Length(Data)); > >> Socket.Close; > > > > I think this is better: > > > >> Socket.Send(@Data[0], Length(Data)); > >> Socket.Shutdown(1); > > This can be dangerous, Shutdown(1) disables sends on the socket, > if not all has been sent yet you'll get a socket exception > on the next internal send attempt. Best practise is to set a > flag and call it from OnDataSent if that flag is set. > Well, you could check WSocket.AllSent however what would > you do if it returnd False? > > -- > Arno Garrels > > > -- > 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 -- 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