anchor.diff:  
   %% --------------------------------------------------------------------------------
   %% -- Helper functions
  +init_transport(TransportModule, URIRec, TransportOpts, ProtocolOpts, ClientOpts) ->
  +    case TransportModule:init_transport(URIRec, TransportOpts) of
  +        {ok, TransportState} ->
  +            NotificationSink = proplists:get_value(notification_sink, ProtocolOpts, undefined),
  +            ProtocolMod = proplists:get_value(protocol, ProtocolOpts, hello_proto_jsonrpc),
  +            case hello_proto:init_client(ProtocolMod, ProtocolOpts) of
  +                {ok, ProtocolState} ->
  +                    State = #client_state{transport_mod = TransportModule,
  +                                          transport_state = TransportState,
  +                                          protocol_mod = ProtocolMod,
  +                                          protocol_opts = ProtocolOpts,
  +                                          protocol_state = ProtocolState,
  +                                          notification_sink = NotificationSink},
  +                    evaluate_client_options(ClientOpts, State);
  +                {error, Reason} -> {stop, Reason}
  +            end;
  +        {error, Reason} -> {stop, Reason}
  +    end.
  +
  +evaluate_client_options(ClientOpts, State) ->
  +    KeepAliveInterval = proplists:get_value(keep_alive_interval, ClientOpts, -1),
  +    if
  +        KeepAliveInterval =< 0 ->
  +            {ok, State#client_state{keep_alive_interval = -1}};
  +        KeepAliveInterval > 0 ->
  +            timer:send_after(KeepAliveInterval, self(), ?PING),
  +            {ok, State#client_state{keep_alive_interval = KeepAliveInterval}}
  +    end.
  +
   incoming_message({error, _Reason, NewTransportState}, State) -> %%will be logged later
       {noreply, State#client_state{transport_state = NewTransportState}};
   incoming_message({ok, Signature, BinResponse, NewTransportState},
  
positive.code:     end.
  
  outgoing_message(Request, From, State = #client_state{protocol_mod = ProtocolMod, protocol_opts = ProtocolOpts,
                                                        transport_mod = TransportModule, transport_state = TransportState, async_request_map = AsyncMap}) ->
      case hello_proto:encode(ProtocolMod, ProtocolOpts, Request) of
          {ok, BinRequest} ->
              Signature = hello_proto:signature(ProtocolMod, ProtocolOpts),
  
negative.code:         {ok, URIRec = #ex_uri{}, _} ->
              case uri_client_module(URIRec) of
                  {NewURIRec, TransportModule} ->
                      init_transport(TransportModule, NewURIRec, TransportOpts, ProtocolOpts, ClientOpts);
                  badscheme -> {stop, badscheme}
              end;
          _Other -> {stop, badurl}
      end.
  
  %% @hidden
  