anchor.diff:          _  -> NewState = State#state{messages = []},
                 gen_server:cast(TransportPid, {send, [Messages]})
       end,
  -    {noreply, NewState#state{transport_pid = TransportPid}}.
  +    {noreply, NewState#state{transport_pid = TransportPid}, ?TIMEOUT}.
   
  +handle_info(timeout, State) ->
  +    case check_transport_health(State) of
  +        dead      -> error_logger:info_msg("Session is dead!"),
  +                     {stop, normal, State};
  +        unhealthy -> error_logger:info_msg("Session is unhealthy!"),
  +                     {noreply,
  +                      State#state{failed_health_checks=State#state.failed_health_checks + 1},
  +                      ?TIMEOUT};
  +        ok        -> error_logger:info_msg("Session is fine"),
  +                     {noreply,
  +                      State#state{failed_health_checks=0},
  +                      ?TIMEOUT}
  +    end;
  +% TODO (trotter): We're getting weird messages from the app server,
  +%                 need to investigate.
   handle_info(_Info, State) ->
  -    {noreply, State}.
  +    {noreply, State, ?TIMEOUT}.
   
   terminate(_Reason, _State) ->
       ok.
  
positive.code: %%--------------------------------------------------------------------
  %% Internal Functions
  %%--------------------------------------------------------------------
  
  send_data_to_server(Data) ->
      {ok, Url} = application:get_env(chloe, application_server_url),
  
negative.code: -export([init/1, handle_call/3, handle_cast/2, handle_info/2,
           terminate/2, code_change/3]).
  
  -record(state, {transport_pid, messages, failed_health_checks}).
  
  -define(TIMEOUT, 13 * 1000).        % Primes are fun
  -define(HEALTH_CHECK_THRESHOLD, 4). % Five fails == death
  
  %%--------------------------------------------------------------------
  %% API functions
  