socketexception

java.net.socketException:operation time out when running app on real device

怎甘沉沦 提交于 2019-11-29 17:41:55
this code works fine on emulator, but on real device it gives java.net.SocketException :the operation timed out ive got a php script running on my xampp server. package com.example.new1; import java.io.BufferedReader; import java.io.InputStreamReader; import java.net.HttpURLConnection; import java.net.URL; import android.os.AsyncTask; import android.os.Bundle; import android.app.Activity; import android.view.Menu; import android.view.View; import android.widget.TextView; public class MainActivity extends Activity { TextView tx; StringBuilder stringBuilder; @Override protected void onCreate

Cannot catch SocketException

妖精的绣舞 提交于 2019-11-29 12:02:23
I am trying out Dart and I've been struggling with this for quite a bit now. Calling: runServer() { HttpServer.bind(InternetAddress.ANY_IP_V4, 8080) .then((server) { server.listen((HttpRequest request) { request.response.write('Hello, World!'); request.response.close(); }); }); } Once works like a charm. And then, trying try { runServer(); } on Error catch (e) { print("error"); } on Exception catch(f) { print("exception"); } Now I'd expect that if I were to use this try-catch and start listening to the same port more than once, because I'm catching ALL exceptions and ALL errors, the program

SocketTimeout with opened connection in MongoDB

孤人 提交于 2019-11-29 08:29:39
问题 I've a Java application that performs some aggregations on MongoDB, but sometimes it just hangs and throw a SocketTimeout exception. After the Exception the app will run just fine (for a bit, then it will probably raise again the exception). I've just found this explanation that seems a possible cause but I'm not sure. I initalize the MongoClient and keep the connection to the DB open. I'm not sure if this could be a problem and I should just get everytime the database and then let the

How can I establish a secure channel for SSL/TLS from a handheld device?

可紊 提交于 2019-11-29 08:13:20
I am trying to call a REST method from a handheld device (Windows CE / Compact framework) with this code: public static HttpWebRequest SendHTTPRequestNoCredentials(string uri, HttpMethods method, string data, string contentType) { ExceptionLoggingService.Instance.WriteLog("Reached fileXferREST.SendHTTPRequestNoCredentials"); WebRequest request = null; try { request = WebRequest.Create(uri); request.Method = Enum.ToObject(typeof(HttpMethods), method).ToString(); request.ContentType = contentType; ((HttpWebRequest)request).Accept = contentType; ((HttpWebRequest)request).KeepAlive = false; (

Too many open files ( ulimit already changed )

 ̄綄美尐妖づ 提交于 2019-11-28 21:29:36
I'm working on a debian server with tomcat 7 and java 1.7. This is an application that recieves several TCP connections, each TCP connection is an open file by the java process. Looking at /proc/pid of java/fd I found that, sometimes, the number of open files exceeds 1024, when this happens, I find in catalina.out log the stacktrace _SocketException: Too many open files_ Everything I find about this error, people refer to the ulimit, I have already changed this thing and the error keeps happening. Here is the config: at /etc/security/limits.conf root soft nofile 8192 root hard nofile 8192 at

java.net.SocketException: No buffer space available (maximum connections reached?): connect

亡梦爱人 提交于 2019-11-28 09:11:20
Hi I am using Apache HTTP Client 4.0 to upload some files on a server based on HTTPS protocol. The uploaded application is running 24x7. Today suddenly it started to throw this exception- java.net.SocketException: No buffer space available (maximum connections reached?): connect at java.net.PlainSocketImpl.socketConnect(Native Method) at java.net.PlainSocketImpl.doConnect(Unknown Source) at java.net.PlainSocketImpl.connectToAddress(Unknown Source) at java.net.PlainSocketImpl.connect(Unknown Source) at java.net.SocksSocketImpl.connect(Unknown Source) at java.net.Socket.connect(Unknown Source)

How to solve “Connection reset by peer: socket write error”?

冷暖自知 提交于 2019-11-28 08:16:19
When I am reading the file content from server it returns the following error message: Caused by: java.net.SocketException: Connection reset by peer: socket write error at java.net.SocketOutputStream.socketWrite0(Native Method) at java.net.SocketOutputStream.socketWrite(Unknown Source) at java.net.SocketOutputStream.write(Unknown Source) at org.apache.coyote.http11.InternalOutputBuffer.realWriteBytes(InternalOutputBuffer.java:215) at org.apache.tomcat.util.buf.ByteChunk.flushBuffer(ByteChunk.java:462) at org.apache.tomcat.util.buf.ByteChunk.append(ByteChunk.java:366) at org.apache.coyote

Cannot catch SocketException

爱⌒轻易说出口 提交于 2019-11-28 05:36:39
问题 I am trying out Dart and I've been struggling with this for quite a bit now. Calling: runServer() { HttpServer.bind(InternetAddress.ANY_IP_V4, 8080) .then((server) { server.listen((HttpRequest request) { request.response.write('Hello, World!'); request.response.close(); }); }); } Once works like a charm. And then, trying try { runServer(); } on Error catch (e) { print("error"); } on Exception catch(f) { print("exception"); } Now I'd expect that if I were to use this try-catch and start

Android : Socket - java.net.SocketException: sendto failed: EPIPE (Broken pipe)

隐身守侯 提交于 2019-11-27 14:47:15
I am trying to make connection with server using socket. The connection pipe is broken as shown below exceptions. 01-31 14:47:16.536: W/System.err(27255): java.net.SocketException: sendto failed: EPIPE (Broken pipe) 01-31 14:47:16.550: W/System.err(27255): at libcore.io.IoBridge.maybeThrowAfterSendto(IoBridge.java:496) 01-31 14:47:16.550: W/System.err(27255): at libcore.io.IoBridge.sendto(IoBridge.java:465) 01-31 14:47:16.550: W/System.err(27255): at java.net.PlainSocketImpl.write(PlainSocketImpl.java:507) 01-31 14:47:16.550: W/System.err(27255): at java.net.PlainSocketImpl.access$100

ClientAbortException: java.net.SocketException: Connection reset by peer: socket write error [duplicate]

戏子无情 提交于 2019-11-27 14:01:38
This question already has an answer here: java.net.SocketException: Connection reset 9 answers I am getting the following error frequently while retrieving file object from database column. How can I resolve this problem? May 8, 2009 3:18:14 PM org.apache.catalina.core.StandardHostValve status WARNING: Exception Processing ErrorPage[errorCode=404, location=/error.jsp] ClientAbortException: java.net.SocketException: Connection reset by peer: socket write error at org.apache.catalina.connector.OutputBuffer.doFlush(OutputBuffer.java:327) at org.apache.catalina.connector.OutputBuffer.flush