- negate = "not "
- print(" %sconnected (%d ms), total %d ms connected"
- % (negate, new.current_connection_duration,
- new.total_connected_duration))
-
- if (old.last_disconnected != new.last_disconnected):
+ negate = "dis"
+ print(" %sconnected" % negate)
+
+ if (old.last_connected != new.last_connected or
+ (new.msec_since_connect != None and
+ old.msec_since_connect != new.msec_since_connect - delta) or
+ (old.total_connected_duration != new.total_connected_duration - delta
+ and not (old.total_connected_duration == 0 and
+ new.total_connected_duration == 0))):
+ print(" last connected %d ms ago, connected %d ms total"
+ % (new.msec_since_connect, new.total_connected_duration))
+
+ if (old.last_disconnected != new.last_disconnected or
+ (new.msec_since_disconnect != None and
+ old.msec_since_disconnect != new.msec_since_disconnect - delta)):