4

We are getting a java.net.SocketTimeoutException on server B when client A connects to server B. No idea why. The client is sending data to the server and the server then throws this exception. How would one troubleshoot this issue?

Note currently this has happened only once. Not sure if this is reproduceable. Attempting to setup the test again..

2 Answers 2

1

I had same problems, when my users used 3G or 2G network. It means, that you send request to server, and can't estabilish connection, because of weak internet signal. You can increase timeouts on your connection

URLConnection connection;
int timeout = 30 * 1000; 
connection.setConnectTimeout(timeout);
connection.setReadTimeout(timeout);

But if you have weaaak weeeaaaak internet connection, timeouts does not help you. I'm just created 1 testFunction in WebService (or you can use one of yours) for testing connection with server before calling another required functions, and if I get SockectTimeoutException calling this function - just report to user notification "Weak internet connection!".

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

Comments

0

No data arrived at the receiver within the timeout period. That's all it means. Debugging it means finding out why the data you think was sent wasn't sent. A missing flush() for example.

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.