Commits

Oscar Hellström  committed 304fc9f

Avoid sending exit messages from test webserver

  • Participants
  • Parent commits 1815b38

Comments (0)

Files changed (1)

File test/webserver.erl

 -module(webserver).
 
 -export([start/2]).
--export([accept_connection/3]).
+-export([accept_connection/4]).
 
 start(Module, Responders) ->
     LS = listen(Module),
-    spawn_link(?MODULE, accept_connection, [Module, LS, Responders]),
+    spawn_link(?MODULE, accept_connection, [self(), Module, LS, Responders]),
     port(Module, LS).
 
-accept_connection(Module, ListenSocket, Responders) ->
+accept_connection(Parent, Module, ListenSocket, Responders) ->
     Socket = accept(Module, ListenSocket),
-    server_loop(Module, Socket, nil, [], Responders).
+    server_loop(Module, Socket, nil, [], Responders),
+    unlink(Parent).
 
 server_loop(Module, Socket, _, _, []) ->
     Module:close(Socket);