Francois PIETTE wrote: >> Francois PIETTE wrote: >> Concerning a client idle timeout in a server application/component >> where would you refresh client's last alive time stamp? It's clear to >> refresh it in OnDataAvailable, but that is not enough, it has to be >> refreshed also when data is being sent. Should I use/override >> TryToSend for this purpose? What if someone would put 2GB into the >> send buffer? > > There is an event triggered when TWSocket send each data pacet: > OnSendData which is perfect in that case.
I forgot this event completely :) I hope it's not too slow calling GetTickCount from it. >> Hmm, I see multi-threading issues, since a timer always fires in >> context of the thread where it has been created. > > What if TIcsTimer post a message to the calling component when the > programmed timer event has occured ? Wouldn't this would solve all > multithread issues ? Then TIcsTimer would have to manage a list of linked ICS-Components. When the timer fires it has to iterate thru this list. But deferencing a component pointer which might have been already destroyed (by another thread) will crash, right? You probably can make that threadsafe, however I fear it would slow down performance too much? --- Arno Garrels [TeamICS] http://www.overbyte.be/eng/overbyte/teamics.html -- 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