I have a function that I want to allow to run for a given length of time and then, if it hasn't quit on it's own, abort. What is the best way to do this?
The best I have thought of would be to run it in another thread, wait with a timeout for it to die and then use Thread.Abort() to kill it (this might not work if the function has the w...
http://msdn.microsoft.com/en-us/library/system.net.sockets.socketasynceventargs.aspx
Starting with the above msdn example I'm trying to write a timeout check which will close inactive client sockets and free up resources.
This is what I have come up with. But I'm not sure if its completely thread-safe and if there is a better way to do...
I have to check if a set of file paths represent an existing file.
It works fine except when the path contains a network share on a machine that's not on the current network. In this case it takes a pretty long time (30 or 60 seconds) to timeout.
Questions
Is there a way to shorten the timeout for non existing network shares? (I'm ce...
I am getting sqlcommand timeout issues when I debug the application even though the stored procedure runs in less than 25 seconds in management studio. I set the timeout attribute to 180 seconds and still get the error. Any suggestions?
...
I have a list of around 5,000 to 10,000 (individual user supplied) email addresses from people all over the world, each associated with their username and language codes. I also have a single message translated into the different languages of the users that I want to email. Now, I would like to send a single plain text email to each of t...
I have a site that has worked fine for a while. Recently, any form passed as a querystring ('GET') that has the words "SELECT", "FROM", and "WHERE" in it causes the page to hang and, eventually, give a "Page not found..." error. It looks like this only happens with IE, not Firefox, but has been confirmed using several clients. Also, i...
Part of my app caches web pages for offline viewing. To do that, I am
saving the HTML fetched from a site and rewriting img urls to point to
a file on the local store. When I load the html into a UIWebView, it
loads the images as expected and everything's fine. I am also caching
stylesheets in this fashion.
The problem is that when I pu...
I'm using a NSMutableURLRequest to connect to a web site to get a JSON response. I'm doing so by generating the request, and then using NSURLConnection with a delegate of self to handle the async connection. I've implemented all the normal delegate methods:
- (void)connection:(NSURLConnection *)connection didReceiveData:(NSData *)data...
I assigned a timeout to my window.resize handler so that I wouldn't call my sizable amount resize code every time the resize event fires. My code looks like this:
<script>
function init() {
var hasTimedOut = false;
var resizeHandler = function() {
// do stuff
return false;
};
window.onresize = function() {
if (hasTi...
I am trying to log what is happening when the Client gets a time out on a Web Service call.
Take a look at the HelloWorld code below. This is what I wish to do, but it seems IsClientConnected does not work as it allways return true.
[WebMethod]
public string HelloWorld() {
//.. Do the Webservice stuff
if (!Context.Response.IsC...
I've set both Timeout and ReadWriteTimeout of HttpWebRequest, and still GetRequestStream does not time out when trying to connect to a non-existent server. I've run into similar problems in the past when the DNS resolution was struck, but this time the server in question is running on my own machine (localhost) so this not relevant.
The...
Here's some code:
Client client = new Client(Protocol.HTTP);
client.setConnectTimeout(1); //milliseconds
Response response = client.post(url, paramRepresentation);
System.out.println("timed out");
What I would expect to happen is that it prints "timed out" before the resource has time to process. Instead, nothing happens with the tim...
SO users,
I have 3 threads running simultaneously at any given time, trouble is after thread 1 tries to connect to a server by passing a username to it thread 2 is being invoked and by the time its thread 1's turn the server closes its connection on the code.
Is there anywhere I can implement sending username and password simultaneousl...
Hi,
I have recently implemented the Swiftmailer library, but the first time I used it, I got a php timeout error even though it only had to send out mails to around 300 people.. (I should mention that using the set_time_limit(0); workaround is not an option due to restrictions on the server)
The way I use it is like this:
$transport ...
I have an issue whereby SQL Server Reporting Services graph image URLs become unavailable after attempting to just request the images after a few minutes (instead of also refreshing the HTML).
The actual error is:
"The stream cannot be found. The stream identifier that is provided to an operation
cannot be located in the report server d...
I have a Java application with three threads that open, each, a socket and connect to a server on different ports.
I set so_timeout on each of these sockets after the connection to the server is established.
After that the threads block waiting on read().
Only one of the threads times out after 20 seconds (which is the timeout I set).
Th...
Hi
I am wondering how can I hide/remove a tag after a certain amount of time. Is there some built in thing or do I do use threading(if javascript can do this?)
...
I am trying to find HTML inside a DIV in the Ajax HTML response:
$j(responseText).find("#my_DIV").html()
This works perfectly in FF but IE6 seems to hang and wait forever for the find() to finish, is there a work around to finding a DIV or is there something I am doing wrong?
...
We're running a web service as a web site project. Clients make requests which return after a few seconds, but which spawn a thread that should run for hours. The thread makes web requests and writes to a database, and is throttled with Thread.Sleep calls.
After running for about 20 minutes with several threads running, all the thread...
Is there any way to make a PDO object throw an error if a query takes too long? I have tried PDO::ATTR_TIMEOUT to no effect.
I'd like a way to have a query throw an error if it is running for longer than a certain amount of time. This is not something that I can do in the database, ie, no maintenance jobs running on the db or anything...