anchor.diff:  
   handle_info(prod, {Info, State=#state{packets=[], messages={_,[]}}}) ->
       % Timer triggered a send, but packets/msgs queue empty
  +    lager:debug("[molderl] Sending heartbeat... Stream:~p, SeqNum:~p.~n", [Info#info.stream_name, State#state.sequence_number]),
       send_heartbeat(Info, State#state.sequence_number),
       TRef = erlang:send_after(Info#info.prod_interval, self(), prod),
       {noreply, {Info, State#state{timer_ref=TRef}}};
  
positive.code:     flush(Info, SeqNum, Pckts);
  
  flush(Info=#info{stream_name=Name, socket=Socket}, SeqNum, [{Start, Msgs}|Pckts]) ->
      {EncodedMsgs, EncodedMsgsSize, NumMsgs} = molderl_utils:encode_messages(Msgs),
      Payload = molderl_utils:gen_messagepacket(Name, SeqNum, NumMsgs, EncodedMsgs),
      case gen_udp:send(Socket, Info#info.destination, Info#info.destination_port, Payload) of
  
negative.code:             {stop, Reason, {Info, State}}
      end;
  
  % finally handle if the msg is not big enough to promotes the current msgs buffer to a packet
  handle_cast({send, Msg, _}, {Info, OldState=#state{messages={Start, Msgs}, buffer_size=Size}}) ->
      State = OldState#state{messages={Start, [Msg|Msgs]}, buffer_size=Size+byte_size(Msg)+2},
      {noreply, {Info, State}};
  
  handle_cast({sequence_number, SeqNum}, {Info, State}) ->
      {noreply, {Info, State#state{sequence_number=SeqNum}}}.
  