4

In my application am downloading loads o data . every thing fine but some it was giving wierd response and throwing socketException : connectiontimout?

please can any one tell me what are the reasons for these exception ? so that i can figure out problem ?

Gimme some solution to avoid these kind of exceptions

Here log goes ............

**

04-19 15:44:52.591: WARN/System.err(18199): java.net.SocketException: Connection timed out
04-19 15:44:52.591: WARN/Smack/Packet(209): notify conn break (IOEx), close connection
04-19 15:44:52.591: DEBUG/Smack(209): [XMPPConn] close connection, notifyClosed=false
04-19 15:44:52.591: WARN/System.err(18199):     at org.apache.harmony.luni.platform.OSNetworkSystem.read(Native Method)
04-19 15:44:52.591: WARN/System.err(18199):     at dalvik.system.BlockGuard$WrappedNetworkSystem.read(BlockGuard.java:273)
04-19 15:44:52.591: WARN/System.err(18199):     at org.apache.harmony.luni.net.PlainSocketImpl.read(PlainSocketImpl.java:458)
04-19 15:44:52.591: WARN/System.err(18199):     at org.apache.harmony.luni.net.SocketInputStream.read(SocketInputStream.java:85)
04-19 15:44:52.591: WARN/System.err(18199):     at java.io.BufferedInputStream.read(BufferedInputStream.java:319)
04-19 15:44:52.591: WARN/System.err(18199):     at org.apache.harmony.luni.internal.net.www.protocol.http.FixedLengthInputStream.read(FixedLengthInputStream.java:44)
04-19 15:44:52.591: WARN/System.err(18199):     at java.io.BufferedInputStream.read(BufferedInputStream.java:319)
04-19 15:44:52.591: WARN/System.err(18199):     at java.io.FilterInputStream.read(FilterInputStream.java:133)
04-19 15:44:52.591: WARN/System.err(18199):     at com.logictreeit.pilot.utils.Download.Download1(Download.java:245)
04-19 15:44:52.591: WARN/System.err(18199):     at com.logictreeit.pilot.utils.Download.access$4(Download.java:225)
04-19 15:44:52.591: WARN/System.err(18199):     at com.logictreeit.pilot.utils.Download$DownloadTask.doInBackground(Download.java:171)
04-19 15:44:52.591: WARN/System.err(18199):     at com.logictreeit.pilot.utils.Download$DownloadTask.doInBackground(Download.java:1)
04-19 15:44:52.591: WARN/System.err(18199):     at android.os.AsyncTask$2.call(AsyncTask.java:185)
04-19 15:44:52.591: WARN/System.err(18199):     at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:306)
04-19 15:44:52.591: WARN/System.err(18199):     at java.util.concurrent.FutureTask.run(FutureTask.java:138)
04-19 15:44:52.591: WARN/System.err(18199):     at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1088)
04-19 15:44:52.591: WARN/System.err(18199):     at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:581)
04-19 15:44:52.591: WARN/System.err(18199):     at java.lang.Thread.run(Thread.java:1019)

**

Regards, Srinivas

2 Answers 2

3

"Connection timed out" is an expected behavior in a network environment. It's even more expected in a mobile environment, where network connections can be unreliable. It means that the server failed to respond for a certain number of seconds.

Because it's normal behavior, you'll need to handle it in your android application. Either attempt to retry, display an error message to your user, or do something else appropriate.

Sign up to request clarification or add additional context in comments.

Comments

0

AIX: IBM Java: java.net.SocketException: Connection timed out:could be due to invalid address The same is true for android

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.