websockex icon indicating copy to clipboard operation
websockex copied to clipboard

Can't find how to trigger handle_disconnect during process initilization.

Open artempankov opened this issue 8 years ago • 3 comments

handle_disconnect works perfectly for infinite reconnection like in issue 5 - when host got down after some time

but it does not handle connection error in WebSockex.start_link - so if there is no connection to host, application does not start: 21:18:29.799 [info] Application arbi exited: Arbi.Application.start(:normal, []) returned an error: shutdown: failed to start child: Arbi.WsSup ** (EXIT) shutdown: failed to start child: Arbi.WsWorker ** (EXIT) %WebSockex.ConnError{original: :econnrefused}

artempankov avatar Mar 04 '18 18:03 artempankov

Hi, it's actually an option for start and start_link.

Though it does need to be easier to find.

Azolo avatar Mar 04 '18 23:03 Azolo

thank you and sorry! may be it could be true by default, i could not imagine application that will not start because of connection timeout - it may be a temporary network glitch.

artempankov avatar Mar 05 '18 06:03 artempankov

It seems it's not working. I am trying this options to handle initial connection failure but no luck. What am I doing wrong here? [{:name, global_name()}, {:handle_initial_conn_failure, true}]

vipul2774 avatar Mar 05 '22 14:03 vipul2774