anchor.diff:      start_link(Host, Port, Service, []).
   
   start_link(Host, Port, Service, Options) when is_integer(Port), is_atom(Service), is_list(Options) ->
  -    gen_server:start_link(?MODULE, [Host, Port, Service, Options], []).
  +    case gen_server:start_link(?MODULE, [Host, Port, Service, Options], []) of
  +        {ok, Pid} ->
  +            case gen_server:call(Pid, {connect, Host, Port, Service}) of
  +                ok ->
  +                    {ok, Pid};
  +                Error ->
  +                    Error
  +            end;
  +        Else ->
  +            Else
  +    end.
   
   call(Client, Function, Args)
     when is_pid(Client), is_atom(Function), is_list(Args) ->
  
positive.code: %%                         {stop, Reason}
  %% Description: Initiates the server
  %%--------------------------------------------------------------------
  init([Host, Port, Service, Options]) ->
      State = parse_options(Options, #state{}),
  
      TcpOptions = [binary,
                    {packet, 0},
                    {active, false},
                    {nodelay, true}],
      TcpTimeout = State#state.connect_timeout,
  
      case catch gen_tcp:connect(Host, Port, TcpOptions, TcpTimeout) of
          {ok, Sock} ->
              {ok, Transport} = thrift_socket_transport:new(Sock),
              {ok, BufTransport} =
  
negative.code: %% cleaning up. When it returns, the gen_server terminates with Reason.
  %% The return value is ignored.
  %%--------------------------------------------------------------------
  terminate(Reason, State = #state{protocol=undefined}) ->
      ok;
  terminate(Reason, State = #state{protocol=Protocol}) ->
      thrift_protocol:close_transport(Protocol),
      ok.
  
  