anchor.diff:      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) ->
  +connect(ServerPath) when is_list(ServerPath) ->
  +    Domain   = local,
  +    ServerSA = #{family => Domain, path => ServerPath},
  +    Opts     = #{domain => Domain,
  +                 proto  => default,
  +                 method => plain},
  +    do_connect(ServerSA, Opts).
  +
  +connect(Addr, Port) when is_tuple(Addr) andalso is_integer(Port) ->
  +    Domain   = inet,
  +    ServerSA = #{family => Domain,
  +                 addr   => Addr,
  +                 port   => Port},
  +    Opts     = #{domain => Domain,
  +                 proto  => tcp,
  +                 method => plain},
  +    do_connect(ServerSA, Opts);
  +connect(ServerPath,
  +        #{domain := local = Domain, proto := default} = Opts)
  +  when is_list(ServerPath) ->
  +    ServerSA = #{family => Domain, path => ServerPath},
  +    do_connect(ServerSA, Opts).
  +
  +connect(Addr, Port, #{domain := Domain, proto := tcp} = Opts) ->
  +    ServerSA = #{family => Domain,
  +                 addr   => Addr,
  +                 port   => Port},
  +    do_connect(ServerSA, Opts).
  +
  +do_connect(ServerSA, #{domain := Domain,
  +                       proto  := Proto, 
  +                       method := Method} = Opts) ->
       try
   	begin
   	    Sock =
  -		case socket:open(inet, stream, tcp) of
  +		case socket:open(Domain, stream, Proto) of
   		    {ok, S} ->
   			S;
   		    {error, OReason} ->
   			throw({error, {open, OReason}})
   		end,
  -	    case socket:bind(Sock, any) of
  +            LocalSA = which_sa(Domain),
  +	    case socket:bind(Sock, LocalSA) 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
  +	    case socket:connect(Sock, ServerSA) of
   		ok ->
   		    ok;
   		{error, CReason} ->
  
positive.code: 	]).
  
  
  -define(READER_RECV_TIMEOUT, 1000).
  
  -define(DATA_MSG(Sock, Method, Data),
  
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},
  