added end-of_batch flag to message, reworked session::send_batch