socketexception

Broadcasting over Wi-Fi Direct

走远了吗. 提交于 2019-12-02 19:25:39
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: sendto failed: ENETUNREACH (Network is unreachable) 03-20 13:23:00.148: E/UdpBroadcaster(4180): at

data:, shown in the chrome url bar when I execute the following Selenium ChromeWebdrive Script

删除回忆录丶 提交于 2019-12-02 11:06:25
问题 data:, shown in the chrome url bar when I execute the following Selenium ChromeWebdrive Script. Is the because other instance of chrome browser are working? import org.openqa.selenium.WebDriver; import org.openqa.selenium.chrome.ChromeDriver; public class ChromWebdriverWindows { public static void main(String[] args) { //String url = "https://www.google.co.in/"; System.getProperty("webdriver.chrome.driver", "C:\\Automation\\chromedriver_win32\\chromedriver.exe"); WebDriver drive; drive = new

Android: Socket is closed

喜你入骨 提交于 2019-12-02 10:03:00
PCClient : public class PCServer { /** * @param args */ static Socket socket = null; private static String ip = "192.168.42.129"; private static int port = 18181; public static void main(String[] args) { // TODO Auto-generated method stub try { socket = new Socket(ip, port); } catch (UnknownHostException e1) { // TODO Auto-generated catch block e1.printStackTrace(); } catch (IOException e1) { // TODO Auto-generated catch block e1.printStackTrace(); } try { SendMsg(ip, port, "BZT"); GetMessage getMessage = new GetMessage(); getMessage.start(); } catch (UnknownHostException e) { // TODO Auto

ksoap timeout behind proxy in android

 ̄綄美尐妖づ 提交于 2019-12-02 08:12:59
i tried the example from http://www.helloandroid.com/tutorials/using-ksoap2-android-and-parsing-output-data to get request and response from a wsdl service. its working fine when i tried in a proxyless. but when i work behind proxy,i get "The operation timed out:request time failed: java.net.SocketException" is there any way to set proxy to SoapObject or Soap Envelop? Ksoap does not work behind a proxy. inorder to make that working.. download the HttpTransportSE.java and ServiceConnectionSE.java from sourceforge. Create a package with HttpTransportSE and ServiceConnectionSE. In

data:, shown in the chrome url bar when I execute the following Selenium ChromeWebdrive Script

折月煮酒 提交于 2019-12-02 03:46:55
data:, shown in the chrome url bar when I execute the following Selenium ChromeWebdrive Script. Is the because other instance of chrome browser are working? import org.openqa.selenium.WebDriver; import org.openqa.selenium.chrome.ChromeDriver; public class ChromWebdriverWindows { public static void main(String[] args) { //String url = "https://www.google.co.in/"; System.getProperty("webdriver.chrome.driver", "C:\\Automation\\chromedriver_win32\\chromedriver.exe"); WebDriver drive; drive = new ChromeDriver(); drive.get("https://www.flock.co"); } } Getting this error in console: Starting

Connection reset by peer: socket write error. What is wrong with my Java code

不打扰是莪最后的温柔 提交于 2019-12-02 02:43:22
问题 I am trying to create and maintain a TCP connection to a host from a standalone java application. Local port and server port is same = 8999. After connection, I have to send a msg to the server: < STX >username=fred&password=abcd< ETX > . The code for socket creation and message sending goes like: Socket socket = new Socket("mshxml.abcd.com", 8999, InetAddress.getLocalHost(), 8999); OutputStream outStream = socket.getOutputStream(); while (socket.isConnected()) { try { int stx = 2, etx = 3;

Connection reset by peer: socket write error. What is wrong with my Java code

旧时模样 提交于 2019-12-02 00:49:35
I am trying to create and maintain a TCP connection to a host from a standalone java application. Local port and server port is same = 8999. After connection, I have to send a msg to the server: < STX >username=fred&password=abcd< ETX > . The code for socket creation and message sending goes like: Socket socket = new Socket("mshxml.abcd.com", 8999, InetAddress.getLocalHost(), 8999); OutputStream outStream = socket.getOutputStream(); while (socket.isConnected()) { try { int stx = 2, etx = 3; DataOutputStream dout = new DataOutputStream(outStream); dout.writeByte(stx); dout.writeBytes("username

java.net.SocketException: sendto failed: ECONNRESET (Connection reset by peer)

北慕城南 提交于 2019-12-01 08:43:04
I try to use this code to connect to server for uploading an image. try { url = new URL(requestURL); HttpURLConnection conn = (HttpURLConnection) url.openConnection(); conn.setRequestProperty("connection", "close"); System.setProperty("http.keepAlive", "false"); conn.setReadTimeout(15000); conn.setConnectTimeout(15000); conn.setRequestMethod("POST"); conn.setDoInput(true); conn.setDoOutput(true); OutputStream os = conn.getOutputStream(); BufferedWriter writer = new BufferedWriter( new OutputStreamWriter(os, "UTF-8")); writer.write(getPostDataString(postDataParams)); writer.flush(); writer

C# SocketException doesn't get caught

一笑奈何 提交于 2019-12-01 02:19:35
问题 i have a really weird sitation going on in my code. I'm developping a c# chat client-server application. When i close the server i want the client to be automatically closed. The client is reading from the TcpClient object using a StremReader. The client is in a while loop where it reads a line(StreamReader.ReadLine()) and then doing some operations with the line it reads. When the serever gets closed, i also close the tcp connection server-side. So, i'm expecting the client to see a

SocketTimeout with opened connection in MongoDB

北战南征 提交于 2019-11-30 07:21:25
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 database to be garbage collected (and close the connection). Another approach could be ping periodically