Commits

bob.ippolito  committed 9f9cedd

change default backlog to 128

  • Participants
  • Parent commits 42bb911

Comments (0)

Files changed (1)

File src/mochiweb_socket_server.erl

          ip=any,
          listen=null,
          acceptor=null,
-         backlog=30}).
+         backlog=128}).
 
 start(State=#mochiweb_socket_server{}) ->
     start_server(State);
 
 init(State=#mochiweb_socket_server{ip=Ip, port=Port, backlog=Backlog}) ->
     process_flag(trap_exit, true),
-    BaseOpts = [binary, 
+    BaseOpts = [binary,
                 {reuseaddr, true},
                 {packet, 0},
                 {backlog, Backlog},
     end,
     case gen_tcp_listen(Port, Opts, State) of
         {stop, eacces} ->
-            case Port < 1024 of 
+            case Port < 1024 of
                 true ->
                     case fdsrv:start() of
                         {ok, _} ->
     case gen_tcp:listen(Port, Opts) of
         {ok, Listen} ->
             {ok, ListenPort} = inet:port(Listen),
-            {ok, new_acceptor(State#mochiweb_socket_server{listen=Listen, 
+            {ok, new_acceptor(State#mochiweb_socket_server{listen=Listen,
                                                            port=ListenPort})};
         {error, Reason} ->
             {stop, Reason}
                lists:flatten(io_lib:format("~p", [Other]))]),
             exit({error, accept_failed})
     end.
-            
+
 
 do_get(port, #mochiweb_socket_server{port=Port}) ->
     Port.
-    
+
 handle_call({get, Property}, _From, State) ->
     Res = do_get(Property, State),
     {reply, Res, State};
 
 terminate(_Reason, #mochiweb_socket_server{listen=Listen, port=Port}) ->
     gen_tcp:close(Listen),
-    case Port < 1024 of 
+    case Port < 1024 of
         true ->
             catch fdsrv:stop(),
             ok;
     {noreply, new_acceptor(State)};
 handle_info({'EXIT', _LoopPid, Reason},
             State=#mochiweb_socket_server{acceptor=Pid, max=Max}) ->
-    case Reason of 
+    case Reason of
         normal ->
             ok;
         _ ->