Hi,
I use Socket library do read data from my alarm system.
I open socket connection and continously write command and read answer.
From time to time i get this in the log and the class that is used for this communication freezes.
I mean, I have w timer to check if socket is connected that fires every 5 seconds. After this exception timer ticks are not fired, but after some some they get fired 1 by 1 with 5 ms period.
Here's the log msg:
Is it possible to Try/Catch this exception?
Shall I close and open the socket every time i write new command?
I use Socket library do read data from my alarm system.
I open socket connection and continously write command and read answer.
From time to time i get this in the log and the class that is used for this communication freezes.
I mean, I have w timer to check if socket is connected that fires every 5 seconds. After this exception timer ticks are not fired, but after some some they get fired 1 by 1 with 5 ms period.
Here's the log msg:
B4X:
java.net.SocketTimeoutException: Read timed out
at java.net.SocketInputStream.socketRead0(Native Method)
at java.net.SocketInputStream.read(SocketInputStream.java:150)
at java.net.SocketInputStream.read(SocketInputStream.java:121)
at java.net.SocketInputStream.read(SocketInputStream.java:107)
at anywheresoftware.b4a.randomaccessfile.AsyncStreams$AIN.run(AsyncStreams.java:184)
at java.lang.Thread.run(Thread.java:744)
Is it possible to Try/Catch this exception?
Shall I close and open the socket every time i write new command?