The IVpnPlug Connect call is normally given more than 15 seconds before it times out. Have you looked at the VPN sample on Github?
[UWP] Windows Networking VPN API, timeout for vpnClient background task + behavior
I am implementing a system that uses a vpnClient type background task for use with the Windows Networking VPN API. I've been encountering some weird behavior where it seems like connecting the VPN profile via ConnectProfileAsync, which then in turn triggers my background task, times out after 15 seconds (I am expecting the connection to take around 30 seconds). In this case, it times out and ConnectProfileAsync returns an error of type "Other". In practice, it seems like I can just call the ConnectProfileAsync function again right after failure, and it will pick back right up where it started, eventually leading to a successfully connected profile?? This makes no sense to me. Questions:
- Does anyone have insight into how these background tasks work that would explain the "pick up where it left off" behavior?
- My main issue is the timeout, is there a way to increase this timeout for ConnectProfileAsync? I tried the extendedBackgroundTaskTime restricted capability but that didn't seem to affect anything.
If anyone has any knowledge to share pertaining this, it would be greatly appreciated.
-
Peter Smith 581 Reputation points Microsoft Employee
2022-02-21T19:47:22.44+00:00
1 additional answer
Sort by: Most helpful
-
Nico Zhu (Shanghai Wicresoft Co,.Ltd.) 12,866 Reputation points
2022-02-21T05:03:41.263+00:00 Hello, Welcome to Microsoft Q&A,
Your issue that might be related to VPN and currently there is official code sample that you could refer to.
Thanks
Nico Zhu