Maurizio Lotauro wrote:
I noticed that the HttpCli component return the 404 status code not only when the server return this code but even under different situations. For example when it is unable to resolve the hostname or when wsocket raise an error (please correct me if I'm wrong).
I noticed this too.
In a program I implemented a very simply retry mechanism. The retry will be executed only if the status code returned is not a permanent error (I identified the 408, 503 and 504). The 404 is a permanent one but it is returned even when the socket return 10060 (Connection timed out).
404 in this case is wrong and doesn't reflect the real situation.
I would add a property "RetryCount" to decide how many times a request should be retried in case of non permanent error.
Probably a solution could be to expose the FRequestDoneError field. The status code should be meaningful only if FRequestDoneError=0.
What do you think?
I assumed status code=0 as a socket error, and I modified the source for this behaviour.
Exposing FRequestDoneError is probably better.
-- Marcello Vezzelli CTO Software Development Department E-Works s.r.l. tel. +39 059 2929081 fax +39 059 2925035 Direzionale 70 - Via Giardini 456/c 41100 Modena - Italy
-- 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