Set the allowed cancellation types, default is terminal.
terminal
void set_allowed_cancellation( net::cancellation_type allowed_cancellation_types = net::cancellation_type::terminal);