support requeue for check_old_data
implement retry of failed writes
implement write queue (limit number of bytes that are written to the socket but for which we still do not have a reply)
reopen file on 5003 and 5004 error