anchor.diff:              {{error, einval}, D}
       end.
   
  +%%
  +%% -------
  +%% getopts in server
  +%%
  +
   %% -> {ok, [Options]} | {error, einval}
   state_getopts(P, D, State, Opts) ->
       state_getopts(P, D, State, Opts, []).
  
positive.code: %% -------------------------------------------------------------------------
  
  listen(Port, Opts) ->
      %% ?DBG({Port, Opts}),
      {EinvalOpts, Opts_1} = setopts_split(einval, Opts),
      %% ?DBG([{opts1, Opts_1}]),
      EinvalOpts =:= [] orelse exit(badarg),
      {Mod, Opts_2} = inet:tcp_module(Opts_1),
      %% ?DBG([{mod, Mod}, {opts2, Opts_2}]),
      {StartOpts, Opts_3} = setopts_split(start, Opts_2),
      %% ?DBG([{start_opts, StartOpts}, {opts3, Opts_3}]),
      case Mod:getserv(Port) of
          {ok, TP} ->
              case inet:listen_options([{port, TP} | Opts_3], Mod) of
  
negative.code: 
  -define(CLOSED_SOCKET, #{rstates => [closed], wstates => [closed]}).
  
  %% Options that are inherited by accept/2
  -compile({inline, [socket_inherit_opts/0]}).
  socket_inherit_opts() ->
      [priority].
  
  %%% ========================================================================
  %%% API
  