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