anchor.diff:              ets:delete(Tid, Pid)
       end.
   
  --spec remove_socket(port(), #state{}) -> #state{}.
  +-spec remove_socket(socket(), #state{}) -> #state{}.
   remove_socket(Socket, S = #state{ssl=Ssl, free=Free}) ->
       lhttpc_sock:close(Socket, Ssl),
       S#state{free=drop_and_cancel(Socket,Free)}.
   
  --spec drop_and_cancel(port(), [{port(), reference()}]) -> [{port(), reference()}].
  +-spec drop_and_cancel(socket(), [{socket(), reference()}]) -> [{socket(), reference()}].
   drop_and_cancel(_, []) -> [];
   drop_and_cancel(Socket, [{Socket, TimerRef} | Rest]) ->
       cancel_timer(TimerRef, Socket),
  
positive.code: 
  -spec checkout(host(), port_number(), SSL::boolean(),
                 max_connections(), connection_timeout()) ->
          {ok, port()} | retry_later | no_socket.
  checkout(Host, Port, Ssl, MaxConn, ConnTimeout) ->
      Lb = find_lb({Host,Port,Ssl}, {MaxConn, ConnTimeout}),
      gen_server:call(Lb, {checkout, self()}, infinity).
  
negative.code: -export_types([host/0, port_number/0, max_connections/0, connection_timeout/0]).
  -type host() :: inet:ip_address()|string().
  -type port_number() :: 1..65535.
  -type socket() :: gen_tcp:socket() | ssl:sslsocket().
  -type max_connections() :: pos_integer().
  -type connection_timeout() :: timeout().
  
  