- Added maybe_flush_socket() for use by the generator.