anchor.diff:  
   %%
   %% socket timeout
  -tcp_ttl(#state{so = SOpt} = State) ->
  -   [$? ||
  -      lens:get(lens:pair(timeout, []), lens:pair(ttl, undefined), SOpt),
  +time_to_live(#state{timeout = SOpt} = State) ->
  +   [$? || 
  +      opts:val(ttl, undefined, SOpt), 
         tempus:timer(_, ttl)
      ],
      {ok, State}.
   
  -tcp_tth(#state{so = SOpt} = State) ->
  -   [$? ||
  -      lens:get(lens:pair(timeout, []), lens:pair(tth, undefined), SOpt),
  +time_to_hibernate(#state{timeout = SOpt} = State) ->
  +   [$? || 
  +      opts:val(tth, undefined, SOpt), 
         tempus:timer(_, tth)
      ],
      {ok, State}.
   
  -tcp_ttp(#state{socket = Sock, so = SOpt} = State) ->
  -   [$? ||
  -      lens:get(lens:pair(timeout, []), lens:pair(ttp, undefined), SOpt),
  -      tempus:timer(_, {ttp, erlang:element(2, getstat(Sock))})
  -   ],
  -   {ok, State}.
  -
  -tcp_ttp(N, #state{socket = Sock} = State) ->
  -   case getstat(Sock) of
  -      {ok, X} when X > N ->
  -         tcp_ttp(State);
  +time_to_packet(N, #state{socket = Sock, timeout = SOpt} = State) ->
  +   case knet_gen_tcp:getstat(Sock, Packet) of
  +      X when X > N orelse N =:= 0 ->
  +         [$? ||
  +            opts:val(ttp, undefined, SOpt),
  +            tempus:timer(_, {ttp, X})
  +         ],
  +         {ok, State};
         _ ->
            {error, timeout}
      end.
   
   
  +
  +
   %%
   %% socket up/down link i/o
  -tcp_flow_ctrl(#state{flowctl = true, socket = Sock} = State) ->
  +stream_flow_ctrl(#state{flowctl = true, socket = Sock} = State) ->
      [$^ ||
         setopts(Sock, [{active, ?CONFIG_IO_CREDIT}]),
         fmap(State)
      ];
  -tcp_flow_ctrl(#state{flowctl = once, socket = Sock} = State) ->
  +stream_flow_ctrl(#state{flowctl = once, socket = Sock} = State) ->
      [$^ ||
         setopts(Sock, [{active, ?CONFIG_IO_CREDIT}]),
         fmap(State)
      ];
  -tcp_flow_ctrl(#state{flowctl = _N, socket = Sock} = State) ->
  +stream_flow_ctrl(#state{flowctl = _N, socket = Sock} = State) ->
      [$^ ||
         setopts(Sock, [{active, ?CONFIG_IO_CREDIT}]),
         fmap(State)
      ].
  +
  +%%
  +%%
  +pipe_to_side_a(Pipe, Event, #state{socket = Sock} = State) ->
  +   [$^ ||
  +      knet_gen_tcp:peername(Sock),
  +      fmap(pipe:a(Pipe, {tcp, self(), {Event, _}})),
  +      fmap(State)
  +   ].
  +
  +%%
  +%%
  +pipe_to_side_b(Pipe, Event, #state{socket = Sock} = State) ->
  +   [$^ ||
  +      knet_gen_tcp:peername(Sock),
  +      fmap(pipe:b(Pipe, {tcp, self(), {Event, _}})),
  +      fmap(State)
  +   ].
  +
  +
  +
   
   %%
   tcp_uplink_established(Pipe, #state{socket = Sock} = State) ->
  
positive.code:    T = os:timestamp(),
     case 
        [$^ ||
           tcp_connect(Uri, State0),
           tcp_ltracelog_established(T, _),
           tcp_ttl(_),
           tcp_tth(_),
           tcp_ttp(_),
           tcp_uplink_established(Pipe, _),
           tcp_accesslog_established(T, _),
           tcp_flow_ctrl(_)
        ]
     of
        {ok, State1} ->
  
negative.code:    socket   = undefined :: #socket{}
    ,flowctl  = true      :: once | false | true | integer()  %% flow control strategy
    ,trace    = undefined :: _
    ,timeout  = undefined :: [_]
    ,so       = undefined :: [_]
  }).
  
  