public void addBuffer(Buffer buf){
synchronized (queue) {
    if (queue.size() == QUEUE_SIZE) {
      logger.info("Dropping a packet because the queue is full.");
      if (queueStatistics != null) {
        queueStatistics.remove(System.currentTimeMillis());
      }
      queue.poll();
    }
    queue.offer(buf);
    if (queueStatistics != null) {
      queueStatistics.add(System.currentTimeMillis());
    }
    queue.notifyAll();
  }
}

public void addBuffer ( Buffer buf ) { synchronized ( queue ) { if ( queue . size ( ) == QUEUE_SIZE ) { logger . info ( "Dropping a packet because the queue is full." ) ; if ( queueStatistics != null ) { queueStatistics . remove ( System . currentTimeMillis ( ) ) ; } queue . poll ( ) ; } queue . offer ( buf ) ; if ( queueStatistics != null ) { queueStatistics . add ( System . currentTimeMillis ( ) ) ; } queue . notifyAll ( ) ; } }
adds pkt to this socket . if the queue is full , drops a packet . does not block .
