anchor.diff:     socket = undefined :: #socket{}       %% http i/o streams
     ,queue  = undefined :: datum:q()       %% queue of in-flight request
   
  -  ,recv  = undefined :: htstream:http()  %% ingress packet stream
  -  ,send  = undefined :: htstream:http()  %% egress  packet stream
  +  % ,recv  = undefined :: htstream:http()  %% ingress packet stream
  +  % ,send  = undefined :: htstream:http()  %% egress  packet stream
     ,t     = undefined :: tempus:t()       %% 
     ,peer  = undefined :: uri:uri()        %% identity of remote peer
   
  
positive.code:    catch _:Reason ->
        ?NOTICE("knet [http]: egress failure ~p ~p", [Reason, erlang:get_stacktrace()]),
        % pipe:a(Pipe, {http, self(), eof}),
        {stop, normal, State}
     end.
  
  %%%------------------------------------------------------------------
  
negative.code:       lens:fmap(fun(X) -> deq:poke(X, deq:tail(Queue)) end, Fun(deq:head(Queue)))      
     end.
  
  
  
  
  %%%------------------------------------------------------------------
  %%%
  %%% http socket
  %%%
  %%%------------------------------------------------------------------
  
  %%
  %% 
  -spec gen_http_socket(_) -> #socket{}.
  
  gen_http_socket(SOpt) ->
     #socket{
        in = htstream:new(),
        eg = htstream:new(),
        so = SOpt
     }.
  
  %%
  %%
  -spec gen_http_close(#socket{}) -> #socket{}.
  
  gen_http_close(#socket{so = SOpt}) ->
     gen_http_socket(SOpt).
  
  %%
  %%
  -spec gen_http_send(#socket{}, _) -> {[binary()], #socket{}}.
  
  gen_http_send(#socket{eg = Stream0} = Socket, Data) ->
     {Pckt, Stream1} = htstream:encode(Data, Stream0),
     {Pckt, Socket#socket{eg = Stream1}}.
  
  %%
  %%
  -spec gen_http_recv(#socket{}, _) -> {_, #socket{}}.
  
  gen_http_recv(#socket{in = Stream0} = Socket, Data) ->
     {Pckt, Stream1} = htstream:decode(Data, Stream0),
     {Pckt, Socket#socket{in = Stream1}}.
  