timeout

Set time out on simplexml_load_file

夙愿已清 提交于 2019-12-18 08:24:58
问题 I have this script which outputs an rss feed. Want I want to do is have it attempt to reach the rss url for something like 5 sec tops, and if it cannot then I want it to load a backup xml doc that is on the server. This is what I have and it is not working: <?php include '../php/connect.php'; $metaData = mysql_query("SELECT * FROM `siteinfo`") or die("couln't find table :("); $displayData = mysql_fetch_assoc($metaData); $url = $displayData['status']; $xml = file_get_contents($url); stream_set

How to enforce a definite timeout in perl?

你。 提交于 2019-12-18 06:48:35
问题 I am using LWP to download content from web pages, and I would like to limit the amount of time it waits for a page. my $ua = LWP::UserAgent->new; $ua->timeout(10); $ua->env_proxy; $response = $ua->get("http://XML File"); $content = $response->decoded_content; The problem is that the server will occasionally deadlock (we're trying to figure out why) and the request will never succeed. Since the server thinks it is live, it keeps the socket connection open thus LWP::UserAgent's timeout value

PHP/Javascript Session Timeout with warning

巧了我就是萌 提交于 2019-12-18 05:27:05
问题 Does anyone know where I can read a tutorial on, or know how to create a Javascript-based session timeout that has a warning built in, and optionally these features: user activity resets the timer interacts with database (last seen on, etc.) if inactive, it will log out users (by redirecting to a logout.php page) before it logs users out, it will display a popup message that asks if they want to continue Unfortunately, I don't know too much about Javascript. 回答1: I don't know how your website

How to set the timeout for socket when looking for host?

时光总嘲笑我的痴心妄想 提交于 2019-12-18 05:15:12
问题 In my unit test, I use commons httpclient to request a incorrect remote web site, and the max timeout is: @Test(timeout = 10000) public void should_not_be_accessible_if_configuration_is_incorrect() throws Exception { // use httpclient to visit an invalid remote http web site } But it may throw such an exception in some computers: java.lang.Exception: test timed out after 10000 milliseconds at java.net.Inet4AddressImpl.lookupAllHostAddr(Native Method) at java.net.InetAddress$1

ajax synchronous call with timeout

拥有回忆 提交于 2019-12-18 05:04:10
问题 New to ajax, so asking a very basic question. -- Is there no way to make a Synchronous ajax call (async:false) with timeout set on it.? http://www.ajaxtoolbox.com/request/ Timeout works perfect with Asynchronous call though in my application, but for one particular scenario, I need a Synchronous call (the javascript should actually wait untill it hears back from the server), and this also works fine. But I need to handle a scenario where the sever could take long and a ajax timeout may be

Specify connection timeout in java.nio

大憨熊 提交于 2019-12-18 04:55:08
问题 Using non-blocking I/O, the code for connecting to a remote address looks something like: SocketChannel channel = SelectorProvider.provider().openSocketChannel(); channel.configureBlocking(false); channel.connect(address); The connection process will then have to be finished by invoking finishConnect() on the channel when some selector says the corresponding key isConnectable() . Is there a way to specify the connection timeout when using this idiom? 回答1: Interesting question. I'm not sure

How to reset timeout in Javascript/jQuery?

爷,独闯天下 提交于 2019-12-18 03:55:38
问题 I've got a field A in my webpage which, when edited by the user, invokes an API call (using jQuery), which updates field B. After the edit, the API should be called every 10 seconds to update the field B again. I currently do this using: setTimeout(thisFunction, 10000); The problem is that this timeout is set every time the user edits field A, which after editing field A a couple times causes the timeout to be set multiple times and the API to be called many many times. This makes the website

What is the global default timeout

ε祈祈猫儿з 提交于 2019-12-18 01:43:07
问题 Python 3.4 . Trying to find what is the default timeout in urllib.request.urlopen() . Its signature is: urllib.request.urlopen(url, data=None, [timeout, ]*, cafile=None, capath=None, cadefault=False, context=None) The doc says that its "global default timeout", and looking at the code its: socket._GLOBAL_DEFAULT_TIMEOUT Still what is the actual value in secs? 回答1: I suspect this is implementation-dependent. That said, for CPython: From socket.create_connection, If no timeout is supplied, the

The timeout period elapsed prior to obtaining a connection from the pool

空扰寡人 提交于 2019-12-18 00:50:55
问题 Our site works fine for 90% of the day, then during our peak hours when traffic is about twice as heavy as normal, everything slows down to a crawl. Page load times that are normally 1 second take 30 seconds. Checking our error logs, it looks like it may be a connection pool issue. We have 3 web servers connected to 1 sql server db. The SQL server is flying under 25% utilization on all cores. I look at the User Connections counter on our SQL server and see that during our peak we have 400+

The timeout period elapsed prior to obtaining a connection from the pool

点点圈 提交于 2019-12-18 00:50:49
问题 Our site works fine for 90% of the day, then during our peak hours when traffic is about twice as heavy as normal, everything slows down to a crawl. Page load times that are normally 1 second take 30 seconds. Checking our error logs, it looks like it may be a connection pool issue. We have 3 web servers connected to 1 sql server db. The SQL server is flying under 25% utilization on all cores. I look at the User Connections counter on our SQL server and see that during our peak we have 400+