Re: [twsocket] What is wrong in this code?

2006-02-06 Thread Ionut Muntean
Hi Wilfried, I've already done this. Thank you and Francois and Dod for the responses. Have fun. /Ionut Wilfried Mestdagh wrote: > Hello Ionut, > > Change it like this: > > in the main function: > . > Rec := PrepareRec(true); > Rec.AllDist := Rec.AllDist

Re: [twsocket] What is wrong in this code?

2006-02-06 Thread Wilfried Mestdagh
Hello Ionut, Change it like this: in the main function: . Rec := PrepareRec(true); Rec.AllDist := Rec.AllDist - Dist; Rec.count := RecCount; Send(@Rec, SizeOf(TRec)); Query.Next; . in OnDataSent: ..

Re: [twsocket] What is wrong in this code?

2006-02-06 Thread Francois Piette
Sent: Monday, February 06, 2006 11:26 AM Subject: Re: [twsocket] What is wrong in this code? > Hi Wilfried, > > I've changed the code to this: > > in tha main function: > . > Rec := PrepareRec(true); > Rec.AllDist :=

Re: [twsocket] What is wrong in this code?

2006-02-06 Thread Dod
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

Re: [twsocket] What is wrong in this code?

2006-02-06 Thread Ionut Muntean
Hi Wilfried, I've changed the code to this: in tha main function: . Rec := PrepareRec(true); Rec.AllDist := Rec.AllDist - Dist; Rec.count := RecCount; Send(@Rec, SizeOf(TRec)); Query.Next; repeat

Re: [twsocket] What is wrong in this code?

2006-02-06 Thread Wilfried Mestdagh
Hello Ionut, > The code is executed from OnClientDataAvailable of an TWSocketServer. > When the execution reach the "repeat .. until SentOk", on > ProcessMessages the code is reentered a second time. This is normal. When you start looping processmessages then your code can be reentered because m

Re: [twsocket] What is wrong in this code?

2006-02-06 Thread Ionut Muntean
Thanks Dod for your quick response. In OnClientDataAvailable there is a basic command parser, that receives data from the peer ... / Ionut Muntean Dod wrote: > Don't know but did you "Receive" data before ProcessMessage ? > > OnDataAvailable will be triggered until you read received data. > >

Re: [twsocket] What is wrong in this code?

2006-02-06 Thread Dod
Don't know but did you "Receive" data before ProcessMessage ? OnDataAvailable will be triggered until you read received data. Other thing, you should not do such repeat/until upon Send but better use OnDataSent event to manage sending next record(s). IM> Hi, IM> Please look at the code below. IM

[twsocket] What is wrong in this code?

2006-02-06 Thread Ionut Muntean
Hi, Please look at the code below. . . . try try Query.Open; OnDataSent := DataWasSent; // DataWasSent sets "SentOk" to True while not Query.EOF do begin Rec:= PrepareRec(true);