> Francois PIETTE wrote: >>> I would also vote for a built-in timer since any server needs to >>> perform some tasks periodically, so probably deriving from >>> TComponent plus a window receiving timer messages is a good choice. >> >> Most communication application and many other needs to perform some >> task periodically as well as handle all kind of time out. > > 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. >> It would be usefull to add a general purpose timer component >> able to do a lot of tasks, centralized in a single component. > > I see some problems with V6, since TWndControl does not handle > WM_TIMER messages by default. Such timer should not create a > window but attach to an existing window. I think TWndConrol doesn't have to handle this message explicitely since it calls DefWindowProc for a,y message not explicitely handled and DefWindowProc will cal the callback method set by SetTiler. >> A single TIcsTimer >> component is enough in an application if correctly designed. All >> other components needing a timer could be linked to this TIcsTimer, >> much like many data-aware components are linked to a single >> datasource component or many SQL-Query type component are linked to a >> single database connection component. > > 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 ? -- Contribute to the SSL Effort. Visit http://www.overbyte.be/eng/ssl.html -- [EMAIL PROTECTED] http://www.overbyte.be -- 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