anchor.diff:      case catch gen_tcp:connect(Host, Port,
                                  [{packet, 4}, {active, once}, binary], 10000) of
           {ok, Socket} ->
  +            erlang:send_after(?Timeout, self(), timeout),
               {ok, #state{socket = Socket,
                           module = Module,
                           client = true,
  -                        ssl    = false},  ?Timeout};
  +                        ssl    = false}};
           Reason ->
               log(debug, ?MODULE, init, [Reason, self()],
                   "Shutting down, failed to establish connection.",
  
positive.code:     log(debug, ?MODULE, handle_call, [Function, self()],
          "Send call.", ?LINE, Module),
      doSendPacket(Socket, {rpc, Function, Args, From}),
      {noreply, State, ?Timeout};
  handle_call({call, Function, Args}, From, State = #state{socket = Socket,
                                                           module = Module}) ->
      log(debug, ?MODULE, handle_call, [Function, self()],
          "Send call.", ?LINE, Module),
      doSendPacketSSL(Socket, {rpc, Function, Args, From}),
      {noreply, State, ?Timeout};
  handle_call(_Request, _From, State) ->
      Reply = ok,
      {reply, Reply, State, ?Timeout}.
  
  %%--------------------------------------------------------------------
  %% @private
  
negative.code: handle_info({rpc_result, Result, From}, State = #state{socket = Socket,
                                                         ssl    = false}) ->
      doSendPacket(Socket, {rpc_result, Result, From}),
      {noreply, State};
  handle_info({rpc_result, Result, From}, State = #state{socket = Socket}) ->
      doSendPacketSSL(Socket, {rpc_result, Result, From}),
      {noreply, State};
  handle_info(timeout, State = #state{socket = Socket,
                                      client = true,
                                      ssl    = false,
                                      module = Module}) ->
      doSendPacket(Socket, ping),
  
      %% If we havent received a pong signal withing 60 sek, close connection.
      Ref = erlang:send_after(60000, self(), lostConnection),
  
      erlang:send_after(?Timeout, self(), timeout),
  
      log(debug, ?MODULE, handle_info, [Socket],
          "Sending ping to socket...", ?LINE, Module),
  
      {noreply, State#state{timerRef = Ref}};
  handle_info(timeout, State = #state{socket = Socket,
                                      client = true,
                                      module = Module}) ->
      doSendPacketSSL(Socket, ping),
  
      %% If we havent received a pong signal withing 60 sek, close connection.
      Ref = erlang:send_after(60000, self(), lostConnection),
  
      erlang:send_after(?Timeout, self(), timeout),
  
      log(debug, ?MODULE, handle_info, [Socket],
          "Sending ping to socket...", ?LINE, Module),
  
      {noreply, State#state{timerRef = Ref}};
  handle_info(timeout, State = #state{client = false}) ->
      {noreply, State};
  handle_info(lostConnection, State = #state{module = Module}) ->
      log(error, ?MODULE, handle_info, [State, self()],
          "Lost connection signal received, shutting down...", ?LINE, Module),
      {stop, normal, State};
  handle_info(_Info, State) ->
      {noreply, State}.
  
  
  
  