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: %% cleaning up. When it returns, the gen_server terminates with Reason.
  %% The return value is ignored.
  %%--------------------------------------------------------------------
  terminate(Reason, State = #state{protocol = Protocol}) ->
  %%     error_logger:info_msg("thrift_client ~p terminating due to ~p", [self(), Reason]),
      thrift_protocol:close_transport(Protocol),
      ok.
  
  
negative.code: %%                         {stop, Reason}
  %% Description: Initiates the server
  %%--------------------------------------------------------------------
  init([_Host, _Port, _Service, Options]) ->
      State = parse_options(Options, #state{}),
      {ok, State}.
  
  parse_options([], State) ->
      State;
  parse_options([{strict_read, Bool} | Rest], State) when is_boolean(Bool) ->
      parse_options(Rest, State#state{strict_read=Bool});
  parse_options([{strict_write, Bool} | Rest], State) when is_boolean(Bool) ->
      parse_options(Rest, State#state{strict_write=Bool});
  parse_options([{framed, Bool} | Rest], State) when is_boolean(Bool) ->
      parse_options(Rest, State#state{framed=Bool});
  parse_options([{connect_timeout, TO} | Rest], State) when TO =:= infinity; is_integer(TO) ->
      parse_options(Rest, State#state{connect_timeout=TO}).
  
  %%--------------------------------------------------------------------
  %% Function: %% handle_call(Request, From, State) -> {reply, Reply, State} |
  %%                                      {reply, Reply, State, Timeout} |
  %%                                      {noreply, State} |
  %%                                      {noreply, State, Timeout} |
  %%                                      {stop, Reason, Reply, State} |
  %%                                      {stop, Reason, State}
  %% Description: Handling call messages
  %%--------------------------------------------------------------------
  handle_call({connect, Host, Port, Service}, _From, State = #state{connect_timeout=Timeout}) ->
      Options = [binary,
                 {packet, 0},
                 {active, false},
                 {nodelay, true}],
  
      case catch gen_tcp:connect(Host, Port, Options, Timeout) of
          {ok, Sock} ->
              {ok, Transport} = thrift_socket_transport:new(Sock),
              {ok, BufTransport} =
  