Don't use repeat/until ProcessMessage loop, you don't need it if you manage sending records thru OnDataSent.
IM> Hi Wilfried, IM> I've changed the code to this: IM> in tha main function: IM> ..... IM> Rec := PrepareRec(true); IM> Rec.AllDist := Rec.AllDist - Dist; IM> Rec.count := RecCount; IM> Send(@Rec, SizeOf(TRec)); IM> Query.Next; IM> repeat IM> ProcessMessages IM> until SentOk; IM> ..... -- 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