anchor.diff:              fail
       end.
   
  +-spec send_bundle_if_ready(state()) -> state().
   send_bundle_if_ready(InState) ->
       QL = msg_queue_len(InState),
       case QL of
  
positive.code:                             inc_s_msg_count(T1)
                      end;
                  QL ->
                      DBS = desired_bundle_size(State),
                      MSBS = msgs_since_bundle_start(State),
                      case (QL + MSBS) >= DBS of
                          true ->
                              {MsgQueue, OptionQueue} = msg_queue(State),
                              MQueue = [{DestPid, Message} | MsgQueue],
                              OQueue = [Options | OptionQueue],
  %%                            io:format("Bundle Size: ~p~n", [length(MQueue)]),
                              NewSocket =
                                  send({dest_ip(State), dest_port(State), Socket},
                                       unpack_msg_bundle, MQueue, OQueue, State),
                              T1State = set_socket(State, NewSocket),
                              T2State = inc_s_msg_count(T1State),
                              T3State = set_msg_queue(T2State, {[], []}),
                              T4State = set_msg_queue_len(T3State, 0),
                              _T5State = set_msgs_since_bundle_start(T4State,0);
                          false ->
                              %% add to message bundle
                              {MsgQueue, OptionQueue} = msg_queue(State),
                              T1 = set_msg_queue(State, {[{DestPid, Message} | MsgQueue],
                                                         [Options | OptionQueue]}),
                              set_msg_queue_len(T1, QL + 1)
                      end
              end
  
negative.code:      LastStatReport       :: {RcvCnt::non_neg_integer(), RcvBytes::non_neg_integer(),
                                SendCnt::non_neg_integer(), SendBytes::non_neg_integer()}}.
  -type message() ::
      {send, DestPid::pid(), Message::comm:message(), Options::comm:send_options()} |
      {tcp, Socket::inet:socket(), Data::binary()} |
      {tcp_closed, Socket::inet:socket()} |
      {report_stats} |
  