connection-timeout

How can I set connection timeout for OkHttpClient? 2017

橙三吉。 提交于 2019-12-13 00:07:19
问题 It is easy to say it's duplicate but it isn't. I read many post about how to set the connection timeout in android but the post are 4-7 years old and I think that we all need an update about this topic because those methods are deprecated or no longer exist. So the question is how can I set my connection timeout when I am waiting for a response from the server? final Response response = httpClient.newCall(request).execute(); if (response.isSuccessful()) { //success } else { //unsuccessful }

NHibernate: how to set connection timeout

醉酒当歌 提交于 2019-12-12 07:45:23
问题 Is there any way to globally setup time you would wait for connecting to a given database, before a connection failure in NHibernate (connection timeout)? In ADO.NET you can do it for a single connection like this: new SqlConnection().ConnectionTimeout = 10; I found how to setup the time you would wait for a result set, before a command execution failure here (command timeout). But, apparently, that's not what I need 回答1: You can set it on the connection string, "Connection Timeout=x". 回答2:

file_get_contents Connection Timed Out for some contents

对着背影说爱祢 提交于 2019-12-12 04:48:00
问题 i'm developing a site in which user can upload pictures. Once users insert the url ( only remote ) of image, i call a ajax to a php that take url and store it to the server. The problem is the file_get_contents: For some images it gives me Connection Timed Out, for other no. Some images that gives me that error are: http://www.lloydsbaiahotel.it/images/bgtop/03.jpg http://www.lloydsbaiahotel.it/images/bgtop/04.jpg I simple try to fetch content in this way: $img = "http://www.lloydsbaiahotel

SocketException( Connection timed out ) is thrown when i run my android app on a real device

一世执手 提交于 2019-12-12 01:49:00
问题 My android app needs to perform Http requests through HttpClient. i've tested on the emulator and it works fine. but when i do it on a real device with WIFI activated, sometimes ANR occurred, and sometimes SocketException is thrown. it seems that the device is not able to connect the server. logcat print-out is as follows in addition, the package name for the app is "com.tim.wirelessorder" 06-03 09:51:17.803: W/System.err(2307): java.net.SocketException: The operation timed out 06-03 09:51:17

Wcf decrease client connection timeout

六眼飞鱼酱① 提交于 2019-12-11 15:11:54
问题 I have a wcf service that works fine. The problem is the client. I have a little gui where the user is supposed to place the ip address of where the wcf service is located. Both the client and service are on the same network so if I am not able to connect it is because I provided an incorrect ip address or because the firewall is blocking. Anyways how can I shorten that time so that if the user types the incorrect ip he does not have to wait like 20 seconds? Here is how my app.config file

Google App Engine connection request timeout error

不问归期 提交于 2019-12-11 13:26:15
问题 I am working on a GAE web app which shows movie related data. To get the movie data I am using API from OMDB (http://www.omdbapi.com/) .Below is the code snippet I use to connect to the API. When i run it locally it works perfectly fine, but doesn't work when deployed on GAE. It throws connection timeout exception, i tried increasing connection timeout period but that didn't work. String URLstr = "http://www.omdbapi.com/?t="+URLEncoder.encode(Request,"utf-8"); URL url=null; URLConnection uc =

I set the timeout on the socket, and I found that this value cannot be greater than 21

余生长醉 提交于 2019-12-11 10:15:27
问题 I set the timeout on the socket, which is valid if the value is less than 21 seconds, and after 21 seconds, I find that the timeout is still 21 seconds public static void main(String[] args) { SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss.SSS"); String time1= sdf.format(new Date()); System.out.println(time1); try { Socket sock = new Socket(); SocketAddress socketAddress = new InetSocketAddress("128.28.28.28",80); sock.connect(socketAddress,60000); }catch (Exception ex){ ex

Server timeout error on uploading videos from Android/IOS to Node Server

谁说胖子不能爱 提交于 2019-12-11 07:04:37
问题 I am trying to upload videos from android/IOS client to NodeJS Server. It works fine for smaller videos but when i try to upload a video lets say, larger than 50 MBs, it throws server timeout error . One possible solution in my mind is to increase the server timeout limit, but that doesn't seem to be a proper solution. Is there a proper way to upload videos from android without any limitation? Here is the code that i am using. exports.create = function(req, res) { req.setTimeout(0); var

MySQL 5.6 takes long time to connect, even with the “MySQL 5.6 Command Line Client”

主宰稳场 提交于 2019-12-11 03:22:45
问题 I have had MySQL 5.6.16 and was working perfect suddenly the MySQL connection become so slow to connect (20 - 21 seconds) I have removed it completely even with the data tables and downloaded and installed ver. 5.6.19 with a fresh and new installation, but this didn't fix the long time connection EVEN with the MySQL Command Line Client it takes 20 seconds to return the "mysql>". Also any web-based php code with mysql query connection takes 20 sec to get the data page. I also tried enabling

SSL Connection timeout and read timeouts

空扰寡人 提交于 2019-12-11 01:12:11
问题 I have a doubt on where to set the socket timeout within my code. What I am trying to achieve is that when the socket is created the timeout should be 10seconds. So I am setting it before the handshake. now the error that I see in the logs are of two kinds. 1) Connection Timeout Error and 2) Read timeout Error. So I was wondering if anyone could explain me more about where to set the timeouts. I have the following code: try{ SSLSocketFactory factory=(SSLSocketFactory)SSLSocketFactory