Now we can start the application from the commandline, and still use supervisors.
This commit is contained in:
parent
72e411aee9
commit
af75d731b4
7 changed files with 20 additions and 4 deletions
|
@ -62,7 +62,8 @@ stop() ->
|
|||
%%-----------------------------------------------------
|
||||
|
||||
init([Port]) ->
|
||||
{ok, LSock} = gen_tcp:listen(Port, [{active, true}]),
|
||||
{ok, LSock} = gen_tcp:listen(Port, [{active, true},
|
||||
{reuseaddr, true}]),
|
||||
{ok, #state{port = Port, lsock = LSock}, 0}.
|
||||
|
||||
handle_call(get_count, _From, State) ->
|
||||
|
@ -111,6 +112,8 @@ do_JSCall(Socket, Data, State) ->
|
|||
{echo, RefID, _, MSG} ->
|
||||
send(Socket, RefID, "Your VM is ", getJSVM(RefID, State)),
|
||||
[];
|
||||
{crash, Zero} ->
|
||||
10/Zero;
|
||||
% Set the new state to []
|
||||
Other ->
|
||||
io:format("Got '~p'", [Other]),
|
||||
|
|
Reference in a new issue