Hello all, recently I've started migrating from my own timeout-featured TWSocket descendant towards the ICS built-in timeout. First of all, thanks to Arno for implementing this feature! Usage is quite simple and most of the questions could be answered by reading the code but some things are still lurking in the dark. Here are my questions:
1) In my descendant class I implement true asynchronous Connect with asynchronous DNS lookup before connecting. Of course, I wish to use built-in timeout mechanism for tracking timeouts. But descendant classes haven't access to necessary fields, namely FTimeoutConnectStartTick. And without it I have no means of controlling the timeout. There are two ways as I see it: make FTimeoutConnectStartTick protected or even public - like Counter field is - or add a parameter to TimeoutStartSampling with type TTimeoutReason. Inside this method when parameter is torConnect, FTimeoutConnectStartTick would be assigned. Or, async DNS lookup before connect could be implemented in TWSocket what is the best decision IMHO :) 2) I have listening socket and wish to have its clients disconnected by inactivity timeout. Alas, the sockets created by Accept are never ininialized with timeout code. Of course, I may execute their TimeoutStartSampling manually but then another issue is revealing: TimeoutStartSampling creates Counter but doesn't init it, leaving its fields empty. So in case when client is connecting but sends or receives nothing, it is timeouted immediately! So I guess there should be FCounter.LastSendTick := _GetTickCount after CreateCounter. Regarding accepted sockets I guess some additions should be made too (for example, copying timeout fields from Server to newly created socket) but it's not so critical. 3) I have a TTimer in my thread which owns sockets. May I use TIcsThreadTimer instead and would it be more effective or no difference? -- Anton -- 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