anchor.diff:  	 accept/1, accept/2,
   	 active/2,
   	 close/1,
  -	 connect/2, connect/3,
  +	 connect/1, connect/2, connect/3,
   	 controlling_process/2,
   	 listen/0, listen/1, listen/2,
   	 port/1,
  
positive.code:     socket:close(Sock).
  
  %% Create a socket and connect it to a peer
  connect(Addr, Port) ->
      connect(Addr, Port, #{method => plain}).
  
  connect(Addr, Port, #{method := Method} = Opts) ->
      try
  	begin
  	    Sock =
  		case socket:open(inet, stream, tcp) of
  		    {ok, S} ->
  			S;
  		    {error, OReason} ->
  			throw({error, {open, OReason}})
  		end,
  	    case socket:bind(Sock, any) of
  		{ok, _} ->
  		    ok;
  		{error, BReason} ->
  		    (catch socket:close(Sock)),
  		    throw({error, {bind, BReason}})
  	    end,
  	    SA = #{family => inet,
  		   addr   => Addr,
  		   port   => Port},
  	    case socket:connect(Sock, SA) of
  		ok ->
  		    ok;
  		{error, CReason} ->
  
negative.code: 	    ERROR
      end.
  
  which_sa(local = Domain) ->
      #{family => Domain,
        path   => mk_unique_path()};
  which_sa(_) ->
      any.
  
  mk_unique_path() ->
      [NodeName | _] = string:tokens(atom_to_list(node()), [$@]),
      ?LIB:f("/tmp/esock_~s_~w", [NodeName, erlang:system_time(nanosecond)]).
  
  maybe_start_stats_timer(#{stats_to       := Pid,
                            stats_interval := T},
  