Not able to close DataInputStream of server socket in Android -


on destroying application want close socket connection server , close datainputstream. have put following code in mainactivity.

public void ondestroy()     {         log.d("tag", "destroying");         read_table.flag=false;         try         {             read_table.soc.close();             read_table.input.close();          } catch (ioexception e)         {   log.d("tag", "exception");              e.printstacktrace();         }         super.ondestroy();       } 

readtable service having thread reading data server. when remove application tray, ondestroy() method of main activity executes.

but on server side still able write datainputstream, , there no ioexception delete servers memory.

but on server side still able write datainputstream , there no ioexception

for few writes, yes, ioexception: connection reset peer, when should close socket. because of socket send buffer @ sender.

if server had read socket, have got end of stream.


Comments

Popular posts from this blog

node.js - Using Node without global install -

How to access a php class file from PHPFox framework into javascript code written in simple HTML file? -

java - Null response to php query in android, even though php works properly -