added code for optional ack-based sender flow control