anchor.diff:              gen_tcp:send(Socket, exml:to_iolist(StreamEnd))
       end.
   
  -do_connect(IsSSLConnection, Address, Port, Args, OnConnectFun) ->
  -    Opts = [binary, {active, once}],
  +do_connect(IsSSLConnection, Address, Port, Args, SocketOpts, OnConnectFun) ->
       TimeB = os:timestamp(),
  -    Reply = maybe_ssl_connection(IsSSLConnection, Address, Port, Opts, Args),
  +    Reply = maybe_ssl_connection(IsSSLConnection, Address, Port, SocketOpts, Args),
       TimeA = os:timestamp(),
       ConnectionTime = timer:now_diff(TimeA, TimeB),
       case Reply of
  
positive.code:                 sm_state = {true, 0, inactive} :: sm_state(),
                  replies = []}).
  
  
  %%%===================================================================
  %%% API
  %%%===================================================================
  
negative.code:              {true,false}       -> {true, 0, inactive}
           end,
  
  
      BasicOpts = [binary, {active, once}],
      SocketOpts = case InterfaceIp of
                 undefined -> BasicOpts;
                 _         -> BasicOpts ++ {ip, InterfaceIp} end,
  
      {ok, Socket} = do_connect(IsSSLConnection, Address, Port, Args,
                                SocketOpts, OnConnectFun),
      {ok, Parser} = exml_stream:new_parser(),
      {ok, #state{owner = Owner,
                  socket = Socket,
  