anchor.diff:              end,
               State#state{pending=[], bytes_send=NewBytesSend};
           {error, Reason} ->
  -            erlang:send_after(?RECONNECT, self(), reconnect),
  -            lager:warning("can't send ~p bytes to ~p due to ~p, reconnect!",
  +            NewTRef =
  +            case TRef of
  +                undefined ->
  +                    lager:warning("can't send ~p bytes to ~p due to ~p, reconnect!",
                             [iolist_size(Pending), Node, Reason]),
  -            State#state{reachable=false}
  +                    reconnect_timer();
  +                _ -> TRef
  +            end,
  +            State#state{reachable=false, reconnect_tref=NewTRef}
       end.
   
   connect(#state{node=RemoteNode} = State) ->
  
positive.code:             State#state{reachable=false}
      end;
  handle_message(reconnect, #state{reachable=false} = State) ->
      connect(State);
  handle_message(Msg, #state{node=Node, reachable=Reachable} = State) ->
      lager:warning("got unknown message ~p for node ~p (reachable ~p)",
                    [Msg, Node, Reachable]),
  
negative.code:                 reachable=false,
                  pending = [],
                  max_queue_size,
                  reconnect_tref,
                  bytes_dropped={os:timestamp(), 0},
                  bytes_send={os:timestamp(), 0}}).
  
  