The computer will block all networking after using this vpn view the home page of youtube.com.(may be the vpn client is too away from the vpn server, rtt is above 100ms)
The VpnPlugin.Encapsulate/Decapsulate will not be called any more.
The disconnect button will block, and do not have any effect.
When this bug happened there will be 700-800 threads in the ToyVpn.exe
All those threads blocking at VpnChannel.ProcessEventAsync except mainThread from the threads window of vs2017
Workaround:
Add code in VpnBackgroundTask::Run (IBackgroundTask.Run) to tracking the concurrent callers number in the process, if the concurrent callers is above 1 (a small number like 10 is also ok),then return this VpnBackgroundTask::Run function and do not call VpnChannel.ProcessEventAsync.(ignore this task request)(ask those huge number of rubbish threads exit quickly.)
Ignore task request after connect , do not cause any network packet lost.
Only process one taskInstance in one process will cause only the first connect work, second click on connect will not work.
Add Mutex lock to the whole function of IBackgroundTask.Run will not workaround this problem. It looks ignore the task request is the key of this workaround.
The computer will block all networking after using this vpn view the home page of youtube.com.(may be the vpn client is too away from the vpn server, rtt is above 100ms) The VpnPlugin.Encapsulate/Decapsulate will not be called any more. The disconnect button will block, and do not have any effect. When this bug happened there will be 700-800 threads in the ToyVpn.exe All those threads blocking at VpnChannel.ProcessEventAsync except mainThread from the threads window of vs2017
Workaround:
Add code in VpnBackgroundTask::Run (IBackgroundTask.Run) to tracking the concurrent callers number in the process, if the concurrent callers is above 1 (a small number like 10 is also ok),then return this VpnBackgroundTask::Run function and do not call VpnChannel.ProcessEventAsync.(ignore this task request)(ask those huge number of rubbish threads exit quickly.)
Ignore task request after connect , do not cause any network packet lost.
Only process one taskInstance in one process will cause only the first connect work, second click on connect will not work.
Add Mutex lock to the whole function of IBackgroundTask.Run will not workaround this problem. It looks ignore the task request is the key of this workaround.
Environment: vs 2017 OS build 17763.503