modify client.flush() that is behaves as specified (discarding unread data)