开发者

java.net.SocketException : read time out- Android Exception

java.net.SocketException : read time out

I am trying to communicate with devices from android tablet using socket.

If device is connected on right port and i send the command it works fine. but if i remove the device and sent the command to the socket, during socket connection instead of ConnectionRefused Exception (tested on core java program) it waits for approx 1 min and then send SocketTimeoutException.

Can anyone clarify me that why its happening becoz on one activity i am handling 4 devices if one of the devi开发者_开发技巧ce is not connecten then no device will work.


The connection is not actually refused. Your Socket tries to connect to a device which is not there but the address is valid, so the SocketTimeoutException.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜