timeout

Time limiting a method in C#

烈酒焚心 提交于 2019-12-31 11:00:07
问题 I have a Game framework where there is a list of Bots who implement IBotInterface. These bots are custom made by user with the only limitation that they must implement the interface. The game then calls methods in the bots (hopefully in parallel) for various events like yourTurn and roundStart. I want the bot to only spend a limited amount of time handling these events before being forced to quit computing. An example of the kind of thing i'm trying is : (where NewGame is a delegate) Parallel

Docker machine timeout - how to fix without destroying the machine?

試著忘記壹切 提交于 2019-12-31 08:34:28
问题 I'm having a recurring problem with Docker Machine - every few days it decides to timeout and I am unable to recover it once this happens. Example docker-machine ls NAME ACTIVE DRIVER STATE URL SWARM DOCKER ERRORS default virtualbox Timeout Environment Info uname -a Darwin ColeyMBPR 15.4.0 Darwin Kernel Version 15.4.0: Fri Feb 26 22:08:05 PST 2016; root:xnu-3248.40.184~3/RELEASE_X86_64 x86_64 docker version 1.11.0 docker-machine version 0.7.0 vboxmanage --version 5.0.20r106931 Attempted

setSoTimeout on a client socket doesn't affect the socket

感情迁移 提交于 2019-12-31 04:56:06
问题 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). The other two ignore the timeout. Is it possible that the TCP layer handles only one timeout at a time? Is there any other explanation? 回答1: The documentation

threading.Timer to kill long running task with basic cleanup control

不想你离开。 提交于 2019-12-31 04:25:13
问题 I'd like to monitor a process and auto-kill it if it runs more than N seconds. I'm editing this question in response to the suggestion that it's a duplicate of: Is there any way to kill a Thread in Python? I'd argue that my question is slightly different in that I'm focused on basic cleanup AFTER thread completion (which might actually be more difficult than the aforementioned possible duplicate as everyone seems to say it's impossible). As a simple test, I'm attempting the following to try

PHP session timeout htaccess file

你离开我真会死。 提交于 2019-12-31 02:10:00
问题 Hi i'm new to programming but am currently working on a session timeout problem. Basically my session keeps timing out even though i've changed the session.gc_maxlifetime. I think another script using the same directory to store session data which doesn't have the maxlifetime set, is running and thus it'll use the shorter value instead. TO combat this i've altered the htaccess file but it is still terminating after an 1hr 30mins, i need it to last for longer. My htaccess file is below. I've

PHP session timeout htaccess file

给你一囗甜甜゛ 提交于 2019-12-31 02:08:30
问题 Hi i'm new to programming but am currently working on a session timeout problem. Basically my session keeps timing out even though i've changed the session.gc_maxlifetime. I think another script using the same directory to store session data which doesn't have the maxlifetime set, is running and thus it'll use the shorter value instead. TO combat this i've altered the htaccess file but it is still terminating after an 1hr 30mins, i need it to last for longer. My htaccess file is below. I've

IBM Worklight 6.0.0.1 - Timeout setting in Adapters

依然范特西╮ 提交于 2019-12-30 07:46:49
问题 How can I change the timeout when calling from the application to the adapter using WL.Client.invokeProcedure ? I have read the answer in the following post, but it is not working: How to increase the adapter procedure timeout value in Worklight? My configuration: initOptions.js timeout: 600000 Adapter XML <procedure name="addInsertarMensaje" securityTest="wl_unprotected" requestTimeoutInSeconds="600"> Adapter invocation var timeout = 600000; var invocationOptions = { onSuccess:

Timeout for Blackberry HttpConnection

我只是一个虾纸丫 提交于 2019-12-30 07:40:27
问题 In my project for Blackberry 4.5, I create HttpConnection via Connector.open. If I connect over MDS, I can specify ConnectionTimeout in additional params to my URL. How can I specify timeouts if using direct TCP connection or TCP over WiFi? 回答1: According to this KB article, it's not possible to specify a connection timeout value for transports other than MDS. 回答2: In some cases it's possible to use Http over Socket and SocketConnectionEnhanced with READ_TIMEOUT option: public class

How to detect all touches in Swift 2

橙三吉。 提交于 2019-12-30 06:44:07
问题 I'm trying to create a timeout function for an app I'm develop using Swift 2 but in swift 2, you can put this code in the app delegate and it works but it does not detect any keyboard presses, button presses, textfield presses, and etc: override func touchesBegan(touches: Set<UITouch>, withEvent event: UIEvent?) { super.touchesBegan(touches, withEvent: event); let allTouches = event!.allTouches(); if(allTouches?.count > 0) { let phase = (allTouches!.first as UITouch!).phase; if(phase ==

Android socket connection timeout

我的梦境 提交于 2019-12-30 06:39:14
问题 My android app is connected to the server through socket, which is coded in node.js. When the is left in the foreground for 15 minutes it losses connection to the server. The following is the code that connects the sockt to the server public void connect() { this.connectionStatus = CONNECT_STATUS_CONNECTING; Log.v(AppConstants.DEBUG_TAG, userId + " : Connecting to Server"); if (mThread != null && mThread.isAlive()) { return; } mThread = new Thread(new Runnable() { @Override public void run()