anchor.diff:  
       ConnectOpts = secure_ssl_opts:expand(Host, SslOpts),
       {ok, Socket} = Transport:connect(binary_to_list(Host), Port, ConnectOpts, Timeout),
  +    ok = proc_lib:init_ack({ok, self()}),
       self() ! {upgrade_protocol, Host},
   
       session_manager:reuse_or_create_provider_session(
  
positive.code:             {stop, Reason, State}
      end;
  
  handle_info({Closed, _}, State = #state{closed = Closed}) ->
      {stop, normal, State};
  
  handle_info({Error, Socket, Reason}, State = #state{error = Error}) ->
      ?warning("Connection ~p error: ~p", [Socket, Reason]),
      {stop, Reason, State};
  
  handle_info(timeout, State = #state{socket = Socket}) ->
      ?warning("Connection ~p timeout", [Socket]),
      {stop, normal, State};
  
  % TODO add api call for disconnect
  handle_info(disconnect, State) ->
      {stop, normal, State};
  
  handle_info(Info, State) ->
  
negative.code: %% API
  -export([
      connect_to_provider/7,
      close/1,
      send_sync/2, send_async/2
  ]).
  
  