Every time my midlet connects to the server, a new background thread will be started, and destroyed after data received from the server.

My midlet works well when connecting to the server, and will always succeed in getting whatever data I want if I process "action after action"(without any interrupt), but if I interrupt for a while(do nothing) between two actions, IOException will be thrown. The error message is as follows:

java.io.IOException
at com.sun.cldc.io.j2me.socket.PrivateOutputStream.write1(+25)
at com.sun.cldc.io.j2me.socket.PrivateOutputStream.write(+40)
at java.io.DataOutputStream.write(+10)
at java.io.OutputStream.write(+8)
at com.sun.midp.io.j2me.http.Protocol.sendRequestGeneric(+502)
at com.sun.midp.io.j2me.http.Protocol.sendRequest(+124)
at com.sun.midp.io.j2me.http.Protocol.flush(+35)
at com.sun.midp.io.BaseOutputStream.flush(+11)
at com.sun.cldc.i18n.StreamWriter.flush(+7)
at java.io.OutputStreamWriter.flush(+11)
at org.kxml.io.XmlWriter.flush(+11)
at org.kxml.kdom.Node.write(+9)
at IRSystem.mobile.midlet.IRSMIDlet$DataRetriever.getResultDoc(+83)
at IRSystem.mobile.midlet.IRSMIDlet$DataRetriever.searchCard(+27)
at IRSystem.mobile.midlet.IRSMIDlet$DataRetriever.run(+203)

What's the reason for this problem? I need your help!

Thanks!!