[erlang-questions] Starting an echo web server from (bash) shell!

Ahmed Omar <>
Tue Nov 2 00:03:34 CET 2010


I would suggest you change the code to reveal the original error that you
got
so for Example could you raise the error that you get?
or remove the catch and change the other case clause to {error, Error} and
print out that Error?

{error, Error}->
       io:format("~p~n", [Error])
end.



On Mon, Nov 1, 2010 at 11:09 PM, zabrane Mikael <> wrote:

> Hi list,
>
> I'm facing a strange problem when trying to start my very basic echo
> web server from (bash) shell.
>
> It doesn't work when I try to run it from (bash) shell with an error
> in "gen_tcp:accept/1" call:
> $ erl -s bews
>
>
> But it works fine when I run it from the Erlang shell:
> $ erl
> 1> bews:start().
>
> The server is simply listening on socket 8888 and echo back what it gets:
> ...
> case catch gen_tcp:accept(ListenSocket) of
>        {ok, Sock} ->
>               ...
>        _ ->
>           exit({error,accept_failed})
> end.
>
> Any advices please?
>
> N.B: I'm under OSX Snow Leopard, Erlang R14B (erts-5.8.1)
>
> --
> Regards
> Zabrane
>
> ________________________________________________________________
> erlang-questions (at) erlang.org mailing list.
> See http://www.erlang.org/faq.html
> To unsubscribe; mailto:
>
>


-- 
Best Regards,
- Ahmed Omar
http://nl.linkedin.com/in/adiaa
Follow me on twitter
@spawn_think <http://twitter.com/#!/spawn_think>


More information about the erlang-questions mailing list