deepstream.io-client-java icon indicating copy to clipboard operation
deepstream.io-client-java copied to clipboard

Reconnect throw exception but didn't return it to the method who wants to connect

Open assafAtStampli opened this issue 8 years ago • 0 comments

Hi,

I would like to connect the deepstream and to get error\exception if the action failed after X times (accroding to config). public static void main(String[] args) { try { DeepstreamClient deepstreamClient = new DeepstreamClient("localhost:6020"); deepstreamClient.login(); } catch (Exception e) { e.printStackTrace(); } System.out.print("End"); }

Exception in thread "Timer-10" io.deepstream.DeepstreamException: CONNECTION_ERROR: Connection refused: connect at io.deepstream.DeepstreamClientAbstract.onError(DeepstreamClientAbstract.java:59) at io.deepstream.Connection$1.run(Connection.java:194) at java.util.TimerThread.mainLoop(Timer.java:555) at java.util.TimerThread.run(Timer.java:505)

But after X time, the thread throw exception but didn't return it to the main. The method who call it stay alive without any response. I think the login action should throw checked exception so we can to do something in case the deepstrem is down.

thanks, Assaf

assafAtStampli avatar Oct 28 '18 20:10 assafAtStampli