socket-timeout-exception

Retrofit2 SocketTimeOutException

丶灬走出姿态 提交于 2019-12-12 17:31:13
问题 I setup for Retrofit : private Interceptor interceptor = new Interceptor() { @Override public Response intercept(Chain chain) throws IOException { Request request = chain.request(); if (!NetworkUtil.isNetworkAvailable()) { request = request.newBuilder() .cacheControl(CacheControl.FORCE_CACHE) .build(); } Response response = chain.proceed(request); //Exception here if (NetworkUtil.isNetworkAvailable()) { String cacheControl = request.cacheControl().toString(); response = response.newBuilder()

Setting SO_TIMEOUT for Webservice consumer in mule

泄露秘密 提交于 2019-12-12 02:42:02
问题 We are using webservice consumer to hit a service hosted by 3rd party. While hitting the service, SocketTimeOutException happens after 16 minutes. Our webservice consumer config is as given below. <ws:consumer-config name="config_name" wsdlLocation="${wsdlLocation}" service="Service_name" port="service_portType" serviceAddress="${serviceAddress}" doc:name="Web Service Consumer" /> <ws:consumer config-ref="config_name" operation="test_operation" doc:name="do_it" /> We have a default response

Transfer data from one device to another - android

给你一囗甜甜゛ 提交于 2019-12-11 17:25:21
问题 so I have created two separate apps, one acts as a client & the other acts as a server. Both devices are connected using hotspot: Connection between the devices is successful. For transferring data from the server to the client, I am using the below code: public static String downloadDataFromSender(String apiUrl) throws IOException { InputStream is = null; try { URL url = new URL(apiUrl); HttpURLConnection conn = (HttpURLConnection) url.openConnection(); conn.setReadTimeout(10000 /*

Retrofit SocketTimeoutException (and/or http 500 error) on http-POST

冷暖自知 提交于 2019-12-11 03:09:32
问题 I'm trying to do a POST request to our backend server, but I keep getting SocketTimeOutExceptions or HTTP 500 error. And it keeps switching between those two randomly (even with the same values). Things I've already tried adding OkHttp library (v2.4.0) for some reason I get the error that it's might not be supported though retrofit says it supports v2.0.0+ source implementing Callback<Account> into the class instead of this, it also gave me the http500 more than the newer version this, I've

FTP response 421 received. Server closed connection

烂漫一生 提交于 2019-12-10 01:09:56
问题 I am writing a JAVA code to traverse FTP Location using Apache Commons Net FTPClient and getting output in an Excel file. the code execute correctly for approx 5 min but then gives an IOException: org.apache.commons.net.ftp.FTPConnectionClosedException: FTP response 421 received. Server closed connection. I am using commons-net-3.0.1.jar. I have done some R&D and tried: setDefaultTimeout(6000); setConnectTimeout(3000); setSoTimeout(3000); enterLocalPassiveMode(); and sending NOOP , but still

SocketTimeoutException after converting from http to https in android app

旧时模样 提交于 2019-12-06 14:52:30
I am getting some problems after trying to convert my android app to use SSL to transport information between my android app and web server. (SocketTimeOutException) I have bought a Positive SSL certificate from a Certificate Authority (CA) and configured my server to work with it correctly. I have tested it in my web browser and its working correctly. Now I am trying to modify my android app to use https instead of http but as this is the first time I have used https myself, I am a little confused as to what steps I need to implement in the java code. Currently I am working on my settings

FTP response 421 received. Server closed connection

眉间皱痕 提交于 2019-12-04 23:55:19
I am writing a JAVA code to traverse FTP Location using Apache Commons Net FTPClient and getting output in an Excel file. the code execute correctly for approx 5 min but then gives an IOException: org.apache.commons.net.ftp.FTPConnectionClosedException: FTP response 421 received. Server closed connection. I am using commons-net-3.0.1.jar. I have done some R&D and tried: setDefaultTimeout(6000); setConnectTimeout(3000); setSoTimeout(3000); enterLocalPassiveMode(); and sending NOOP , but still getting the same error. All I am trying to do is traverse through a directory and if file is found than

Downloading files >3Gb from S3 fails with “SocketTimeoutException: Read timed out”

大憨熊 提交于 2019-12-04 19:07:11
问题 AWS Java SDK 1.9.3 When downloading many large files (~3Gb) from AWS S3 in Java server app I get SocketTimeoutException from time to time as following: Caused by: com.amazonaws.AmazonClientException: Unable to store object contents to disk: Read timed out at com.amazonaws.services.s3.internal.ServiceUtils.downloadObjectToFile(ServiceUtils.java:270) at com.amazonaws.services.s3.internal.ServiceUtils.retryableDownloadS3ObjectToFile(ServiceUtils.java:344) at com.amazonaws.services.s3.transfer

Downloading files >3Gb from S3 fails with “SocketTimeoutException: Read timed out”

纵饮孤独 提交于 2019-12-03 12:35:56
AWS Java SDK 1.9.3 When downloading many large files (~3Gb) from AWS S3 in Java server app I get SocketTimeoutException from time to time as following: Caused by: com.amazonaws.AmazonClientException: Unable to store object contents to disk: Read timed out at com.amazonaws.services.s3.internal.ServiceUtils.downloadObjectToFile(ServiceUtils.java:270) at com.amazonaws.services.s3.internal.ServiceUtils.retryableDownloadS3ObjectToFile(ServiceUtils.java:344) at com.amazonaws.services.s3.transfer.TransferManager$2.call(TransferManager.java:737) ... 4 more Caused by: java.net.SocketTimeoutException:

setSotimeout on a datagram socket

时光怂恿深爱的人放手 提交于 2019-12-02 02:40:22
问题 The server acts like an echo server. The clients sends 10 packets to server (1 sec of gap) When Client receives packets from the server, sometimes the packets are lost. So the client has to wait for up to one second for the packet to arrive. If the packet does not arrive in 1 second then the client should continue sending the other packets. How would i use .setSoTimeout to achieve this? Code: import java.io.*; import java.net.*; import java.util.*; /* * Client to process ping requests over