timeout

GetRequestStream throws Timeout exception randomly

被刻印的时光 ゝ 提交于 2019-12-17 18:56:17
问题 After googling for couple of days, I really cannot solve described issue. Hope here will find a solution I'm using attached code when calling WCF service on the same server. I get Timeout error randomly in call WebReq.GetRequestStream() When I'm check netstat I see that connection remains open, so probably is there a problem, but I don't know how to solve it //request inicialization HttpWebRequest WebReq = (HttpWebRequest)WebRequest.Create(url); WebReq.Method = "POST"; WebReq.ContentType =

WCF Not Timing out correctly?

梦想与她 提交于 2019-12-17 18:55:45
问题 I am having a timeout issue, these are the details: My binding configuration looks like this: <netTcpBinding> <binding name="WindowsServerOverTcp" maxReceivedMessageSize="10000000" maxBufferSize="10000000" maxBufferPoolSize="10000000" closeTimeout="00:00:03" openTimeout="00:00:03" sendTimeout="00:00:03" receiveTimeout="00:00:03"> <readerQuotas maxDepth="2147483647" maxStringContentLength="2147483647" maxArrayLength="2147483647" maxBytesPerRead="2147483647" maxNameTableCharCount="2147483647" /

C# task factory timeout

耗尽温柔 提交于 2019-12-17 18:54:58
问题 I have to execute a long process operation in a thread and continue by returning the result to a function. Here is my code : Task<ProductEventArgs>.Factory.StartNew(() => { try { // long operation which return new ProductEventArgs with a list of product } catch (Exception e) { return new ProductEventArgs() { E = e }; } }).ContinueWith((x) => handleResult(x.Result), TaskScheduler.FromCurrentSynchronizationContext()); The problem is actually I don't have a timeout. I want to put a timer in

ruby timeouts and system commands

ぃ、小莉子 提交于 2019-12-17 18:48:23
问题 I have a ruby timeout that calls a system (bash) command like this.. Timeout::timeout(10) { `my_bash_command -c12 -o text.txt` } but I think that even if the ruby thread is interrupted, the actual command keeps running in the background.. is it normal? How can I kill it? 回答1: I think you have to kill it manually: require 'timeout' puts 'starting process' pid = Process.spawn('sleep 20') begin Timeout.timeout(5) do puts 'waiting for the process to end' Process.wait(pid) puts 'process finished

How can I implement timeout for read() when reading from a serial port (C/C++)

人盡茶涼 提交于 2019-12-17 18:41:05
问题 I am reading bytes from a serial port in C++ using a file descriptor and the posix/unix read() function. In this example, I am reading 1 byte from the serial port (baud rate settings and similiar are omitted for clarity): #include <termios.h> #include <fcntl.h> #include <unistd.h> int main(void) { int fd = open("/dev/ttyS0", O_RDWR | O_NOCTTY); char buf[1]; int bytesRead = read(fd, buf, 1); close(fd); return 0; } If the device connected to /dev/ttyS0 does not send any information, the program

Distinguish timeout from user cancellation

北城余情 提交于 2019-12-17 18:08:10
问题 HttpClient has a builtin timeout feature (despite being all asynchronous, i.e. timeouts could be considered orthogonal to the http request functionality and thus be handled by generic asynchronous utilities, but that aside) and when the timeout kicks in, it'll throw a TaskCanceledException (wrapped in an AggregateException ). The TCE contains a CancellationToken that equals CancellationToken.None . Now if I provide HttpClient with a CancellationToken of my own and use that to cancel the

HTTP keep-alive timeout

自古美人都是妖i 提交于 2019-12-17 18:02:02
问题 Can I specify the HTTP timeout or does the server impose a value? For example, if I do: telnet my.server.net 80 Trying X.X.X.X... Connected to my.server.net. Escape character is '^]'. GET /homepage.html HTTP/1.0 Connection: keep-alive Host: my.server.net HTTP/1.1 200 OK Date: Thu, 03 Oct 2013 09:05:28 GMT Server: Apache Last-Modified: Wed, 15 Sep 2010 14:45:31 GMT ETag: "1af210b-7b-4904d6196d8c0" Accept-Ranges: bytes Content-Length: 123 Vary: Accept-Encoding Keep-Alive: timeout=15, max=100

Timeout an async method implemented with TaskCompletionSource

*爱你&永不变心* 提交于 2019-12-17 17:57:07
问题 I have a blackbox object that exposes a method to kick of an async operation, and an event fires when the operation is complete. I have wrapped that into an Task<OpResult> BlackBoxOperationAysnc() method using TaskCompletionSource - that works well. However, in that async wrapper I'd like to manage completing the async call with a timeout error if the event is not received after a given timeout. Currently I manage it with a timer as: public Task<OpResult> BlackBoxOperationAysnc() { var tcs =

MySQL Connection Timeout Issue - Grails Application on Tomcat using Hibernate and ORM

蓝咒 提交于 2019-12-17 17:52:26
问题 I have a small grails application running on Tomcat in Ubuntu on a VPS. I use MySql as my datastore and everything works fine unless I leave the application for more than half a day (8 hours?). I did some searching and apparently this is the default wait_timeout in mysql.cnf so after 8 hours the connection will die but Tomcat won't know so when the next user tries to view the site they will see the connection failure error. Refreshing the page will fix this but I want to get rid of the error

MySQL Connection Timeout Issue - Grails Application on Tomcat using Hibernate and ORM

不问归期 提交于 2019-12-17 17:51:13
问题 I have a small grails application running on Tomcat in Ubuntu on a VPS. I use MySql as my datastore and everything works fine unless I leave the application for more than half a day (8 hours?). I did some searching and apparently this is the default wait_timeout in mysql.cnf so after 8 hours the connection will die but Tomcat won't know so when the next user tries to view the site they will see the connection failure error. Refreshing the page will fix this but I want to get rid of the error