timeout

Resolving an ADO timeout issue in VB6

心已入冬 提交于 2019-12-19 07:35:17
问题 I am running into an issue when populating an ADO recordset in VB6. The query (hitting SQLServer 2008) only takes about 1 second to run when I run it using SSMS. It works fine when the result set is small, but when it gets to be a few hundred records it takes a long time. 800+ records requires about 5 minutes to return (query still only takes 1 second in SSMS), and 6000+ takes well over 20 minutes. I have "fixed" the exception by increasing the command timeout, but I was wondering if there

How to Timeout a request using Html Agility Pack

吃可爱长大的小学妹 提交于 2019-12-19 07:22:15
问题 I'm making a request to a remote web server that is currently offline (on purpose). I'd like to figure out the best way to time out the request. Basically if the request runs longer than "X" milliseconds, then exit the request and return a null response. Currently the web request just sits there waiting for a response..... How would I best approach this problem? Here's a current code snippet public JsonpResult About(string HomePageUrl) { Models.Pocos.About about = null; if (HomePageUrl

How set timeout on XDocument.Load(string uri)?

耗尽温柔 提交于 2019-12-19 07:15:46
问题 Is there a way to set a timeout on System.Linq.Xml.XDocument.Load(string uri)? Or should I use the technique described in Implement C# Generic Timeout? 回答1: There is nothing built-in as far as I'm aware. You can fetch the XML content yourself with an instance of WebRequest (which you can set a timeout on) and then pass the XML data directly to the XDocument.Load method. Technically, the most "robust" solution would be to implement XmlResolver yourself which uses a WebRequest in the GetEntity(

Time out period not elapsed, but still timing out (see code)?

爱⌒轻易说出口 提交于 2019-12-19 04:56:38
问题 OK I keep getting this error after about 3-4 minutes of churning: Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not responding. Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. Exception Details: System.Data.SqlClient.SqlException: Timeout expired. The timeout period elapsed prior to completion

python threading.timer set time limit when program runs out of time

◇◆丶佛笑我妖孽 提交于 2019-12-19 04:47:26
问题 I have some questions related to setting the maximum running time of a function in Python. In fact, I would like to use pdfminer to convert the .pdf files to .txt . The problem is that very often, some files are not possible to decode and take extremely long time. So I want to set threading.Timer() to limit the conversion time for each file to 5 seconds. In addition, I run under windows so I cannot use the signal module for this. I succeeded in running the conversion code with pdfminer

Node JS mysql database disconnect

房东的猫 提交于 2019-12-19 04:33:49
问题 I am using Node JS and I am trying to connect to a mysql database. It keeps getting disconnected due to a timeout so I wrote a function to reconnect if it does timeout. Although I need it to be a continuous connection or references in my code won't work. Here is my relevant code: var mysql = require('mysql'); var connection = mysql.createConnection({ host : '.........', // MySQL Host user : '.........', // MySQL User password : '.........', // MySQL Password database : '.........' // MySQL

timeout for function (jQuery)

断了今生、忘了曾经 提交于 2019-12-19 04:12:24
问题 function getNames(){ // some code } This function can be done in one second, but sometimes it freezes itself and html block on the page (ajax inside) on infinite time. I would like to have time limit for this function. If it doesn't finish in ten seconds, then abort it. How to do this? 回答1: This is really easy with jQuery 1.5’s deferred promises. The following example creates a Deferred and sets two timer-based functions to either resolve or reject the Deferred after a random interval.

socket_connect does not timeout

走远了吗. 提交于 2019-12-19 04:05:43
问题 I am using sockets to send data to a server that may not be responding. So I am trying to define a timeout by using this solution in SO. Make PHP socket_connect timeout socket_set_option($socket, SOL_SOCKET, SO_RCVTIMEO, array('sec' => 1, 'usec' => 0)); socket_set_option($socket, SOL_SOCKET, SO_SNDTIMEO, array('sec' => 1, 'usec' => 0)); This works when the connection is made and the server takes too long to respond. But when it can't create a connection socket_connect($socket, $addr, $port);

Alternatives for Javascript Synchronous XMLHttpRequest (as timing out in Safari)

孤者浪人 提交于 2019-12-19 04:04:40
问题 Short version: Looking for a method to wait for an Asynch XHR request or a way to get Synch XHR working in Safari. Much longer version: I'm working on a web service that uses various external data sources mashed together. I am using a Javacript front-end which makes AJAX/XHR calls to my PHP server code. There's no cross-site issues as the client only requests data from my server (the server makes the external data requests). I'm using a synchronous XHR request as I have some post-load

How to set timeout for HTTP request with hyper, tokio and futures in Rust?

不羁的心 提交于 2019-12-19 03:45:14
问题 How do I set a timeout for HTTP request using asynchronous Hyper (>= 0.11)? Here is the example of the code without timeout: extern crate hyper; extern crate tokio_core; extern crate futures; use futures::Future; use hyper::Client; use tokio_core::reactor::Core; fn main() { let mut core = Core::new().unwrap(); let client = Client::new(&core.handle()); let uri = "http://stackoverflow.com".parse().unwrap(); let work = client.get(uri).map(|res| { res.status() }); match core.run(work) { Ok(status