socketexception

Problem with System.Net.Dns.GetHostEntry(dnsServer) on .NET 4.0

北城余情 提交于 2019-12-04 03:59:10
I have been using the following code for months (without problem) in a .NET 2.0/3.5 environment: string server="192.168.1.3"; IPHostEntry ipe = System.Net.Dns.GetHostEntry(server); IPAddress ipa = ipe.AddressList[0]; IPEndPoint ipep = new IPEndPoint(ipa, (int)UdpServices.Domain); Here, server is hardcoded to an IP address, but in my application it could potentially be something like "server.test.com". When converting my project to .NET 4.0, this code stopped working when directly passing an IP address (still works with a hostname). It crashes with this exception: System.Net.Sockets

SocketException: Permission Denied?

旧时模样 提交于 2019-12-03 15:31:26
问题 My LogCat reads: 08-19 09:29:01.964: WARN/System.err(311): java.net.SocketException: Permission denied 08-19 09:29:02.204: WARN/System.err(311): at org.apache.harmony.luni.platform.OSNetworkSystem.createStreamSocketImpl(Native Method) 08-19 09:29:02.214: WARN/System.err(311): at org.apache.harmony.luni.platform.OSNetworkSystem.createStreamSocket(OSNetworkSystem.java:186) 08-19 09:29:02.214: WARN/System.err(311): at org.apache.harmony.luni.net.PlainSocketImpl.create(PlainSocketImpl.java:265)

java.net.SocketTimeoutException: Read timed out

亡梦爱人 提交于 2019-12-03 13:10:26
I have an application with client server architecture. The client use Java Web Start with Java Swing / AWT and the sert uses HTTP server / Servlet with Tomcat. The communication is made from the serialization of objects, create a ObjectOutput serializes a byte array and send to the server respectively called the ObjectInputStream and deserializes. The application follows communicating correctly to a certain time of concurrency where starting to show error "SocketException read timeout". The erro happens when the server invoke the method ObjectInputStream.getObject() in my servlet doPost method

I m getting java.net.SocketException: Connection reset exception while running a load test using Jmeter

别说谁变了你拦得住时间么 提交于 2019-12-03 12:11:16
I m running a load test on login page of my application for 100 users out of 100 20 users are passing rest 80 users i m getting the below exception , Kindly help me with the fix java.net.SocketException: Connection reset at java.net.SocketInputStream.read(Unknown Source) at java.net.SocketInputStream.read(Unknown Source) at org.apache.http.impl.io.AbstractSessionInputBuffer.fillBuffer(AbstractSessionInputBuffer.java:166) at org.apache.http.impl.io.SocketInputBuffer.fillBuffer(SocketInputBuffer.java:90) at org.apache.http.impl.io.AbstractSessionInputBuffer.readLine(AbstractSessionInputBuffer

How to stop printing exception stack trace on Console?

时光总嘲笑我的痴心妄想 提交于 2019-12-03 08:40:28
问题 I wrote a servlet to handle the exceptions occurring in my web app and mapped them in web.xml <error-page> <exception-type>java.lang.Exception</exception-type> <location>/exceptionHandler</location> </error-page> Here is what I have done in the Exception Handling servlet service method: @Override protected void service(HttpServletRequest req, HttpServletResponse arg1) throws ServletException, IOException { Object attribute = req.getAttribute("javax.servlet.error.exception"); if(attribute

Only one usage of each socket address (protocol/network address/port) is normally permitted?

こ雲淡風輕ζ 提交于 2019-12-03 07:47:19
I've been looking for a serious solution on google and i only get "Regisrty solutions" kind of stuff which i don't think even relate to my problem. For some reason i get this Error, while i'm only starting the TcpListner once, and when+if fails i stop the server. I really don't get it. Here is my code: class Program { private static string ServerName = ""; private static string UserName = ""; private static string Password = ""; private static string dbConnectionSring = ""; private static X509Certificate adminCertificate; private static byte[] readBuffer = new byte[4096]; static void Main

Broadcasting over Wi-Fi Direct

五迷三道 提交于 2019-12-03 06:01:00
问题 I'm looking at the possibility to broadcast over a Wi-Fi Direct connection between multiple Android devices. I've created a simple message broadcasting application to test whether or not it works, but so far I haven't been able to broadcast a message. When I try to send the packet I get a SocketException (Network is unreachable): 03-20 13:23:00.148: E/UdpBroadcaster(4180): sendto failed: ENETUNREACH (Network is unreachable) 03-20 13:23:00.148: E/UdpBroadcaster(4180): java.net.SocketException:

java.net.SocketException: Connection reset by peer: socket write error When serving a file

折月煮酒 提交于 2019-12-03 05:43:55
I am trying to implement an HTTP Server using Sockets. If the Client (For example a browser) requests a directory the server displays a list of available files. The problem arises when the client is requesting a file. I get the following error: java.net.SocketException: Connection reset by peer: socket write error at java.net.SocketOutputStream.socketWrite0(Native Method) at java.net.SocketOutputStream.socketWrite(SocketOutputStream.java:113) at java.net.SocketOutputStream.write(SocketOutputStream.java:159) at cf.charly1811.java.web.RequestHandler.writeFile(RequestHandler.java:152) at cf

SocketException: Permission Denied?

女生的网名这么多〃 提交于 2019-12-03 05:13:55
My LogCat reads: 08-19 09:29:01.964: WARN/System.err(311): java.net.SocketException: Permission denied 08-19 09:29:02.204: WARN/System.err(311): at org.apache.harmony.luni.platform.OSNetworkSystem.createStreamSocketImpl(Native Method) 08-19 09:29:02.214: WARN/System.err(311): at org.apache.harmony.luni.platform.OSNetworkSystem.createStreamSocket(OSNetworkSystem.java:186) 08-19 09:29:02.214: WARN/System.err(311): at org.apache.harmony.luni.net.PlainSocketImpl.create(PlainSocketImpl.java:265) 08-19 09:29:02.224: WARN/System.err(311): at java.net.Socket.checkClosedAndCreate(Socket.java:873) 08-19

How to stop printing exception stack trace on Console?

我与影子孤独终老i 提交于 2019-12-03 00:13:29
I wrote a servlet to handle the exceptions occurring in my web app and mapped them in web.xml <error-page> <exception-type>java.lang.Exception</exception-type> <location>/exceptionHandler</location> </error-page> Here is what I have done in the Exception Handling servlet service method: @Override protected void service(HttpServletRequest req, HttpServletResponse arg1) throws ServletException, IOException { Object attribute = req.getAttribute("javax.servlet.error.exception"); if(attribute instanceof SocketException){ // don't do anything }else{ super.service(req, arg1); } }. Problem: The above