/**
  * Explicitly cancels the packet collector so that no more results are queued up. Once a packet
  * collector has been cancelled, it cannot be re-enabled. Instead, a new packet collector must be
  * created.
  */
 public void cancel() {
   // If the packet collector has already been cancelled, do nothing.
   if (!cancelled) {
     cancelled = true;
     conection.removePacketCollector(this);
   }
 }