Skip to content

Commit

Permalink
catch crash on timeout in playdartcp_resolver connect
Browse files Browse the repository at this point in the history
  • Loading branch information
RJ committed Oct 31, 2009
1 parent d110734 commit 369d2c6
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions playdar_modules/playdar-tcp/src/playdartcp_resolver.erl
Expand Up @@ -35,8 +35,11 @@ reader_protocols() ->

init([]) ->
{ok,_} = playdartcp_router:start_link(?CONFVAL({playdartcp,port},60211)),
% Connect to any peers listed in the config file:
lists:foreach(fun({Ip,Port})->playdartcp_router:connect(Ip,Port)end, ?CONFVAL({playdartcp,peers},[])),
% Connect to any peers listed in the config file
% the connect call will timeout+crash if connection fails
lists:foreach(fun({Ip,Port})->
(catch playdartcp_router:connect(Ip,Port))
end, ?CONFVAL({playdartcp,peers},[])),
% Register us as a playdar resolver
playdar_resolver:add_resolver(?MODULE, self()),
% Register our web request handler (for our localhost web gui)
Expand Down

0 comments on commit 369d2c6

Please sign in to comment.