socketexception

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

我怕爱的太早我们不能终老 提交于 2019-12-21 09:33:27
问题 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

SignalR Owin Self-Host on Linux/Mono SocketException when clients lose connection

前提是你 提交于 2019-12-21 04:45:07
问题 I'm running very simple signalr server self-hosted via Owin on ubuntu server 14.04, mono 3.2.8. (code below). Connecting/Disconnecting works fine on both a remote windows server and when I deploy the bits to the linux server. But when a client dies unexpectedly instead of telling signalr that he's disconnecting, that's when I get a never-ending SocketException only on the linux server only. The windows server disconnects the client after about 30 seconds or so, but the linux server spews the

HttpClient ThreadSafeClientConnManager throws “Connection reset”

戏子无情 提交于 2019-12-21 03:03:45
问题 I define HttpClient in 2 different ways: 1. Plain vanilla: client = new DefaultHttpClient(); 2. Thread safe: DefaultHttpClient getThreadSafeHttpClient() { HttpParams params = new BasicHttpParams(); params .setParameter( "http.useragent", "Mozilla/5.0 (Linux; U; Android 1.1; en-us;dream) AppleWebKit/525.10+ (KHTML, like Gecko) Version/3.0.4 Mobile Safari/523.12.2"); HttpProtocolParams.setVersion(params, HttpVersion.HTTP_1_1); HttpProtocolParams.setContentCharset(params, "UTF-8"); final

java.net.ConnectException - Connection Refused Android Emulator

我的梦境 提交于 2019-12-20 10:28:44
问题 I have an android emulator I'm running from eclipse and just trying to connect to a simple socket server I wrote in .NET (c#). The server is running on the same machine on port 4505. I am able to telnet (through PuTTy) to the server and it works just fine, but when I try to connect to the server with the android emulator I get a: java.net.ConnectException - localhost/127.0.0.1:4505 - Connection refused at org.apache.harmony.luni.net error. I'm assuming this is because the emulator is on a

ksoap timeout behind proxy in android

我们两清 提交于 2019-12-20 07:09:31
问题 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? 回答1: Ksoap does not work behind a proxy. inorder to make that working.. download the HttpTransportSE.java and

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

瘦欲@ 提交于 2019-12-19 09:58:22
问题 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

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

不问归期 提交于 2019-12-18 05:18:09
问题 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 =

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

主宰稳场 提交于 2019-12-17 18:52:27
问题 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

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

六眼飞鱼酱① 提交于 2019-12-17 12:19:10
问题 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

java.net.SocketException socket is closed

此生再无相见时 提交于 2019-12-17 09:48:27
问题 I am sending Object for client to server modifying that object at server side and resending it to client. Sending object form client to server is fine its working properly but when I am sending object back it gives exception Socket is closed. Here is code. IntString and ParentObj are classes of which I'm sending objects. Client1 class: import java.net.*; import java.io.*; public class Client1 { public static void main(String args[]) { int arr[] = new int[10]; int length = 6, i, counter_1;