I can not cancel : "IAsyncOperation<WiFiDirectDevice> iAsynwfdDevice = WiFiDirectDevice::FromIdAsync(deviceInfo.Id(), connctionParameter) "

LI LIU 31 Reputation points

I use the WIFI Direct API: FromIdAsync() to connect to the WiFi direct device. I use the wait_for() method to wait for the connection to time out. When the connection times out, I use the cancel method to cancel the connection. After cancel is invoked, the operation status changes to canceled. But from then on, when I re-initiated a WIFI Direct connection to the device, I immediately reported an EEROR. This process lasts 3 minutes. Then I found that when I cancelled the connection and immediately closed the application, I could still see my application running in the task manager of my computer. How can I gracefully cancel the Wi-Fi Direct connection task? The SDK version is 10.0.19041.0.

Universal Windows Platform (UWP)
{count} votes