anchor.diff:  
   listen(Binding, Options) ->
       Port = binding_port(Binding),
  -    ListenOpts = listen_options(Binding, Options),
  +    ListenOpts = listen_options(Options),
       handle_listen(gen_tcp:listen(Port, ListenOpts)).
   
   binding_port(Port) when is_integer(Port) -> Port;
  -binding_port({_Addr, Port}) when is_integer(Port) -> Port; 
  +%% TODO - use Binding to specify bound IP addr
  +binding_port({_Addr, Port}) when is_integer(Port) -> Port;
   binding_port(Other) -> error({invalid_binding, Other}).
   
  -listen_options(_Binding, Opts) ->
  -    %% TODO - use Binding to specify bound IP addr
  +listen_options(Opts) ->
       [binary,
  -     {active, false},
  +     {active,    false},
        {reuseaddr, true},
  -     {backlog, proplists:get_value(backlog, Opts, ?DEFAULT_BACKLOG)},
  -     {recbuf, proplists:get_value(recbuf, Opts, ?DEFAULT_RECBUF)}].
  +     {backlog,   backlog_opt(Opts)},
  +     {recbuf,    recbuf_opt(Opts)}].
   
   handle_listen({ok, LSock}) -> LSock;
   handle_listen({error, Err}) -> error({listen, Err}).
   
  -init_state(HandlerSup, LSock, App) ->
  -    #state{handler_sup=HandlerSup, lsock=LSock, app=App}.
  +backlog_opt(Opts) ->
  +    proplists:get_value(backlog, Opts, ?DEFAULT_BACKLOG).
  +
  +recbuf_opt(Opts) ->
  +    proplists:get_value(recbuf, Opts, ?DEFAULT_RECBUF).
  +
  +accept_timeout_opt(undefined, _Opts) ->
  +    infinity;
  +accept_timeout_opt(_CbMod, Opts) ->
  +    proplists:get_value(
  +      accept_timeout, Opts, ?DEFAULT_ACCEPT_TIMEOUT_FOR_CB).
   
   %%%===================================================================
   %%% Message dispatch
  
positive.code: 
  init([Binding, App, Options]) ->
      HandlerSup = start_handler_sup(),
      LSock = listen(Binding, Options),
      {ok, init_state(HandlerSup, LSock, App), {first_msg, accept}}.
  
  start_handler_sup() ->
      {ok, Sup} = psycho_handler_sup:start_link(),
  
negative.code: 
  handle_msg(accept, noreply, State) ->
      handle_accept(accept(State), State),
      {next_msg, accept, State};
  handle_msg(_Msg, _From, #state{mod=undefined}=State) ->
      {noreply, State};
  handle_msg(Msg, From, #state{app=App, mod=Mod}=State) ->
      handle_msg_cb(Mod:handle_msg(Msg, From, App), State).
  
  handle_msg_cb({noreply, App}, State) ->
      {noreply, State#state{app=App}};
  handle_msg_cb({reply, Reply, App}, State) ->
      {reply, Reply, State#state{app=App}};
  handle_msg_cb({stop, Reason}, State) ->
      {stop, Reason, State}.
  
  accept(#state{lsock=LSock, accept_timeout=Timeout}) ->
      gen_tcp:accept(LSock, Timeout).
  
  handle_accept({ok, Sock}, State) ->
      dispatch_request(Sock, State);
  handle_accept({error, timeout}, State) ->
      ok.
  
  dispatch_request(Sock, #state{handler_sup=Sup, app=App}) ->
      handle_start_handler(psycho_handler_sup:start_handler(Sup, Sock, App)).
  