RTT wrote:
> Isn't the CtrlSocket.State reliable to know if a connection is still
> on? 
No it isn't. Whether or not a connection is still alive can only be 
known if either the FD_CLOSE notification from winsock is received
or an attempt to send or receive failed or succeeded.
For example, unplugging the network cable won't trigger OnSessionClosed
unless an attempt is made to send or receive something. 
TWSocket property KeepAliveOnOff may be used to setup winsock to send
keep-alive packets in the background in order to detect such brocken
connections, however that's not reliable since both peers must support
it and routers have to route the keep-alive packets. 

> I'm trying to reuse an THttpCli, but I'm getting 10053 errors if a
> persistent connection is idle for some time, I suppose the server
> keepalive timeout.

Or the router timed it out. 

> The ICS THttpCli code check this CtrlSocket.State property, to try to
> reuse a connection, but fails because state remains wsConnected, even
> for an already, supposedly (because of the result 10053 errors),
> closed connection.

That's sounds like a bug. I would expect that THttpCli is reset to
default values after that error? 

-- 
Arno Garrels

--
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

Reply via email to