My problem is not with Web sites, but with laboratory instruments that "report" either via built-in HTTP server or via direct TCP connection. Both tend to occasionally "freeze", after the connection has been successfully established. Strangely enough, timeout at socket creation seems to work.
I would appreciate if you would share the "good solution" you mentioned. It has been almost 15 years, but I suspect it will still be good :-D
Thanks!
| [reply] |
| [reply] |
Thanks for both the comments ... Haven't yet had a chance to look at the first response properly though, but looks interesting, and will post back how that works out.
Meantime, yes, a particularly slow response can be got from the following domain: http://www.lxdirect.com
It used to be an active retail site, but they've now re-branded, etc. However, you'll wait up to 30 seconds or so for a response, at which point it fails (try it in a browser first if you like). It was only by chance that I realized that it was causing such a delay, but then figured I would need to handle such instances anyway ...
Thanks again, and any help appreciated.
| [reply] |
I forgot to mention, the other solution to timeouts, and that is to use an event-loop system like POE or Glib. An event loop system will let you setup timers and you can then time other spawned threads. I prefer Glib myself, but see the POE cookbook for possible ready made solutions. Or see Roll your own Event-loop for how to use Glib, but Glib may be a bit hard to install on Win32 without installing Perl/Gtk2.
It is easily installed with Camelbox: A build of Gtk2-Perl for Windows
| [reply] |