diff options
Diffstat (limited to '1.1.x/src/mochiweb/mochiweb_acceptor.erl')
-rw-r--r-- | 1.1.x/src/mochiweb/mochiweb_acceptor.erl | 48 |
1 files changed, 0 insertions, 48 deletions
diff --git a/1.1.x/src/mochiweb/mochiweb_acceptor.erl b/1.1.x/src/mochiweb/mochiweb_acceptor.erl deleted file mode 100644 index 79d172c3..00000000 --- a/1.1.x/src/mochiweb/mochiweb_acceptor.erl +++ /dev/null @@ -1,48 +0,0 @@ -%% @author Bob Ippolito <bob@mochimedia.com> -%% @copyright 2010 Mochi Media, Inc. - -%% @doc MochiWeb acceptor. - --module(mochiweb_acceptor). --author('bob@mochimedia.com'). - --include("internal.hrl"). - --export([start_link/3, init/3]). - -start_link(Server, Listen, Loop) -> - proc_lib:spawn_link(?MODULE, init, [Server, Listen, Loop]). - -init(Server, Listen, Loop) -> - T1 = now(), - case catch mochiweb_socket:accept(Listen) of - {ok, Socket} -> - gen_server:cast(Server, {accepted, self(), timer:now_diff(now(), T1)}), - call_loop(Loop, Socket); - {error, closed} -> - exit(normal); - {error, timeout} -> - exit(normal); - {error, esslaccept} -> - exit(normal); - Other -> - error_logger:error_report( - [{application, mochiweb}, - "Accept failed error", - lists:flatten(io_lib:format("~p", [Other]))]), - exit({error, accept_failed}) - end. - -call_loop({M, F}, Socket) -> - M:F(Socket); -call_loop({M, F, A}, Socket) -> - erlang:apply(M, F, [Socket | A]); -call_loop(Loop, Socket) -> - Loop(Socket). - -%% -%% Tests -%% --include_lib("eunit/include/eunit.hrl"). --ifdef(TEST). --endif. |