Hi,

My application runs as daemon and uploads/downloads data after fixed time
intervals.  I'm using HTC dream with firmware version 1.1. When phone is
locked/sleep mode then after some time i start getting following error while
reading or writing to socket. I checked the network status by using
connectivitymanager.getNetworkInfo(0).isConnected()  and it always return
true

> java.net.SocketException: The system call was cancelled

Following is excerpt of code which throws exception when phone is
locked/sleep mode


            connectionSocket = new Socket();
            InetAddress serverAddr = InetAddress.getByName(host);
            connectionSocket.connect(new InetSocketAddress(serverAddr,
port), 3000);
            connectionSocket.setSoTimeout(10000);
            outputStream = new
PrintStream(connectionSocket.getOutputStream());
            inputStream = new BufferedReader(new
           InputStreamReader(connectionSocket.getInputStream()));

Everything works fine when phone is unlocked. Can anybody tell me what's
causing the issue when phone is locked?

Regards,
shaz

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to