'if cleanup interval expired, close connections not updated in last interval'

def cleanup(self, ts):

    ts = util.mktime(ts)
    if (self.cleanupts < (ts - self.cleanupinterval)):
        for conn in self.connectionsDict.values():
            if (util.mktime(conn.endtime) <= self.cleanupts):
                self.close(conn)
        self.cleanupts = ts
