Re: [twsocket] HTTP persistent connections
RTT wrote: > On 07-03-2011 06:31, Arno Garrels wrote: >> 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. > And, at least by this post > http://www.mail-archive.com/twsocket@elists.org/msg02934.html > don't seems to be working at winsock level either I tested it at that time on XP and it worked fine in my LAN. -- 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
Re: [twsocket] HTTP persistent connections
RTT wrote: > On 07-03-2011 06:31, Arno Garrels wrote: >> That's sounds like a bug. I would expect that THttpCli is reset to >> default values after that error? > I don't see any reference to "10053" in any of the ICS code, so I > suppose this situation is not being handled internally by the > THttpCli. Because the THttpCli try to reuse the connection, it should > be also the responsible to retry with a new connection too, if while > reusing it resulted in this specific error. The THttpCli should not handle reconnects in such cases, however the default values should be restored whenever the connection closed unexpectedly. It's another story if an exception raised, after that the component user is responsible to reset it to a consistent state, Abort might work in most cases however recreate the object from scratch is the secure way. In order to debug and replay this issue try disconnecting the network cable while a connection persists, do a request and try to find the reason why the state is not reset after the failure, just an idea? -- 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
Re: [twsocket] HTTP persistent connections
On 07-03-2011 06:31, Arno Garrels wrote: 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. And, at least by this post http://www.mail-archive.com/twsocket@elists.org/msg02934.html don't seems to be working at winsock level either -- 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
Re: [twsocket] HTTP persistent connections
On 07-03-2011 06:31, Arno Garrels wrote: That's sounds like a bug. I would expect that THttpCli is reset to default values after that error? I don't see any reference to "10053" in any of the ICS code, so I suppose this situation is not being handled internally by the THttpCli. Because the THttpCli try to reuse the connection, it should be also the responsible to retry with a new connection too, if while reusing it resulted in this specific error. -- 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
Re: [twsocket] HTTP persistent connections
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
[twsocket] HTTP persistent connections
Isn't the CtrlSocket.State reliable to know if a connection is still on? 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. 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. Can someone, please, shed some light on this? While doing some related research, I found this info http://support.microsoft.com/kb/813827/en-us Is IE, other browsers do the same, doing this just to free remote server resources, or is using this timeout to discard a possible no more reliable, after this idle time, persistent connection? Something that needs to be implemented in the THttpCli too? Rui -- 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