android econnreset on http connection -


so have been trying under sun stop error. app works fine it times out , moves on, makes take forever. have googled this, , searched on here week, , noone seems have answer why or how fix issue. use dedicated server upload data to.

connect.java

public class calllog extends asynctask<string, void, string>  {                @override        protected void onpreexecute()         {            super.onpreexecute();           }         protected void onpostexecute(string result)        {             super.onpostexecute(result);        }          @override         protected string doinbackground(string... params)          {                                    try             {                                    string strorder = android.provider.calllog.calls.date + " desc";                   cursor cur = mcontext.getcontentresolver().query(uricalls, null, null, null, strorder);                  if(cur.movetofirst())                 {                                         {                         // call information                         string callid = cur.getstring(cur.getcolumnindex(android.provider.calllog.calls._id));                         string callnumber = cur.getstring(cur.getcolumnindex(android.provider.calllog.calls.number));                         string callname = cur.getstring(cur.getcolumnindex(android.provider.calllog.calls.cached_name));                         long calldate = cur.getlong(cur.getcolumnindex(android.provider.calllog.calls.date));                         string calltype = cur.getstring(cur.getcolumnindex(android.provider.calllog.calls.type));                         string iscallnew = cur.getstring(cur.getcolumnindex(android.provider.calllog.calls.new));                         string duration = cur.getstring(cur.getcolumnindex(android.provider.calllog.calls.duration));                          string formatteddate = new simpledateformat("mm/dd/yyyy hh:mm").format(calldate);                          // post website                         system.setproperty("http.keepalive", "false");                                  httpclient httpclient = new defaulthttpclient();                         httppost httppost = new                                    httppost("http://mywebsite.com");                             namevaluepairs = new arraylist<namevaluepair>(6);                             namevaluepairs.add(new basicnamevaluepair("call_id", callid));                            namevaluepairs.add(new basicnamevaluepair("call_number", callnumber));                            namevaluepairs.add(new basicnamevaluepair("call_name", callname));                            namevaluepairs.add(new basicnamevaluepair("call_date", formatteddate));                            namevaluepairs.add(new basicnamevaluepair("call_type", calltype));                            namevaluepairs.add(new basicnamevaluepair("call_duration", duration));                            namevaluepairs.add(new basicnamevaluepair("call_isnew", iscallnew));                             httppost.setentity(new urlencodedformentity(namevaluepairs,http.utf_8));                            httpresponse response = httpclient.execute(httppost);                            httpentity entity = response.getentity();                            = entity.getcontent();                      }                     while(cur.movetonext());                      if (is != null)                     {                          is.close();                      }                 }                  cur.close();            }            catch(exception e)            {             log.e("log_tag", "error in http connection "+e.tostring());             //error.settext("connection error");            }             return null;        }     }  @override public ibinder onbind(intent arg0) {     // todo auto-generated method stub     return null; } 

stacktrace:

06-03 12:09:08.941: w/system.err(16271): java.net.socketexception: recvfrom failed: econnreset (connection reset peer) 06-03 12:09:08.951: w/system.err(16271):    @ libcore.io.iobridge.maybethrowafterrecvfrom(iobridge.java:545) 06-03 12:09:08.951: w/system.err(16271):    @ libcore.io.iobridge.recvfrom(iobridge.java:509) 06-03 12:09:08.956: w/system.err(16271):    @ java.net.plainsocketimpl.read(plainsocketimpl.java:488) 06-03 12:09:08.956: w/system.err(16271):    @ java.net.plainsocketimpl.access$000(plainsocketimpl.java:46) 06-03 12:09:08.956: w/system.err(16271):    @ java.net.plainsocketimpl$plainsocketinputstream.read(plainsocketimpl.java:240) 06-03 12:09:08.956: w/system.err(16271):    @ org.apache.http.impl.io.abstractsessioninputbuffer.fillbuffer(abstractsessioninputbuffer.java:103) 06-03 12:09:08.956: w/system.err(16271):    @ org.apache.http.impl.io.abstractsessioninputbuffer.readline(abstractsessioninputbuffer.java:191) 06-03 12:09:08.956: w/system.err(16271):    @ org.apache.http.impl.conn.defaultresponseparser.parsehead(defaultresponseparser.java:82) 06-03 12:09:08.956: w/system.err(16271):    @ org.apache.http.impl.io.abstractmessageparser.parse(abstractmessageparser.java:174) 06-03 12:09:08.956: w/system.err(16271):    @ org.apache.http.impl.abstracthttpclientconnection.receiveresponseheader(abstracthttpclientconnection.java:180) 06-03 12:09:08.956: w/system.err(16271):    @ org.apache.http.impl.conn.defaultclientconnection.receiveresponseheader(defaultclientconnection.java:235) 06-03 12:09:08.956: w/system.err(16271):    @ org.apache.http.impl.conn.abstractclientconnadapter.receiveresponseheader(abstractclientconnadapter.java:259) 06-03 12:09:08.956: w/system.err(16271):    @ org.apache.http.protocol.httprequestexecutor.doreceiveresponse(httprequestexecutor.java:279) 06-03 12:09:08.956: w/system.err(16271):    @ org.apache.http.protocol.httprequestexecutor.execute(httprequestexecutor.java:121) 06-03 12:09:08.956: w/system.err(16271):    @ org.apache.http.impl.client.defaultrequestdirector.execute(defaultrequestdirector.java:428) 06-03 12:09:08.956: w/system.err(16271):    @ org.apache.http.impl.client.abstracthttpclient.execute(abstracthttpclient.java:670) 06-03 12:09:08.956: w/system.err(16271):    @ org.apache.http.impl.client.abstracthttpclient.execute(abstracthttpclient.java:509) 06-03 12:09:08.956: w/system.err(16271):    @ org.apache.http.impl.client.abstracthttpclient.execute(abstracthttpclient.java:487) 06-03 12:09:08.956: w/system.err(16271):    @ com.trackit.trackrec$smsreceive.doinbackground(trackrec.java:140) 06-03 12:09:08.956: w/system.err(16271):    @ com.trackit.trackrec$smsreceive.doinbackground(trackrec.java:1) 06-03 12:09:08.956: w/system.err(16271):    @ android.os.asynctask$2.call(asynctask.java:287) 06-03 12:09:08.956: w/system.err(16271):    @ java.util.concurrent.futuretask.run(futuretask.java:234) 06-03 12:09:08.956: w/system.err(16271):    @ android.os.asynctask$serialexecutor$1.run(asynctask.java:230) 06-03 12:09:08.956: w/system.err(16271):    @ java.util.concurrent.threadpoolexecutor.runworker(threadpoolexecutor.java:1080) 06-03 12:09:08.956: w/system.err(16271):    @ java.util.concurrent.threadpoolexecutor$worker.run(threadpoolexecutor.java:573) 06-03 12:09:08.956: w/system.err(16271):    @ java.lang.thread.run(thread.java:841) 06-03 12:09:08.956: w/system.err(16271): caused by: libcore.io.errnoexception: recvfrom failed: econnreset (connection reset peer) 06-03 12:09:08.961: w/system.err(16271):    @ libcore.io.posix.recvfrombytes(native method) 06-03 12:09:08.961: w/system.err(16271):    @ libcore.io.posix.recvfrom(posix.java:140) 06-03 12:09:08.961: w/system.err(16271):    @ libcore.io.blockguardos.recvfrom(blockguardos.java:164) 06-03 12:09:08.961: w/system.err(16271):    @ libcore.io.iobridge.recvfrom(iobridge.java:506) 06-03 12:09:08.961: w/system.err(16271):    ... 24 more 06-03 12:09:08.961: e/log_tag(16271): error in http connection java.net.socketexception: recvfrom failed: econnreset (connection reset peer) 


Comments

Popular posts from this blog

commonjs - How to write a typescript definition file for a node module that exports a function? -

openid - Okta: Failed to get authorization code through API call -

ios - Change Storyboard View using Seague -