      fprintf(stderr,
  	    "IPTapAgent(%s): sendpkt called while in read-only mode!\n",
  	    name());
-@@ -245,7 +441,7 @@
+@@ -245,7 +442,7 @@
    
    // send packet into the live network
    hdr_cmn* hc = HDR_CMN(p);

 			clock_ = tod();
 		} else {
 			double diff = p->time_ - clock_;
@@ -1031,12 +1209,14 @@
 			if (diff > RTSCHEDULER_MINWAIT) {
 				Tcl_Time to;
 				to.sec = long(diff);

-		p = head();
+
 		if (p && (clock_ - p->time_) > slop_) {
-			fprintf(stderr,
-				"RealTimeScheduler: warning: slop "
-				"%f exceeded limit %f [clock_:%f, p->time_:%f]\n",
-				clock_ - p->time_, slop_, clock_, p->time_);
+		    num_violation_++;
+		    if (num_violation_ == 1 ) {
+			clock_first_violation_ = clock_;
+		    } else if(num_violation_ == VIOLATION_THRESHOLD) {
+			double diff = clock_ - clock_first_violation_;
+			if (diff < VIOLATION_TIME_THRESHOLD) {
+			    if (evsink_) {
+				evsink_->send_nseswap();
+			    }
+			} else {
+			    clock_first_violation_ = clock_;
+			    num_violation_ = 1;
+			}
+		    }
+		    fprintf(stderr,
+			    "RealTimeScheduler: warning: slop "
+			    "%f exceeded limit %f [clock_:%f, p->time_:%f]\n",
+			    clock_ - p->time_, slop_, clock_, p->time_);
+		    clock_ = tod();
 		}
 		// handle "old events"
 		while (p && p->time_ <= clock_) {
 
