Closed nferreyra closed 12 years ago
Thanks for your suggestion, hope you like the implementation.
Hi Peter. I believe that will not fix the problem. The timeout you are setting is for connection timeouts and not for inactivity on the socket like absence of HTTP responses.
To validate it you can hijack your host table making api.pachube.com to 127.0.0.1 and start nc on port 80: nc -l 80
After that you just need to put something to pachube to see it blocking.
Thanks
I modified the code as suggested, let me know of any issues.
I Peter. I found out some blocking situations due to missing 200 OK from Pachube. In that circumstances the put method will block indefinitely. My suggestion is to setup a socket timeout just after creating the request. Something like:
This make the connection to unblock after a 5s socket inactivity. You can also make it a property of the constructor. Please continue the good work.
Thank you