question

AlexanderSbitnev-4464 avatar image
0 Votes"
AlexanderSbitnev-4464 asked ·

VPN Plugin framework and detection of closed peer connection

Hi there!
I spent some time playing with UWPToyVpn sample and been able to run it with packets flowing through StreamSocket.
But I am not able to find a way to detect event of connection reset initiated by peer. Since VpnChannel is associated and running this socket there should be a way to get such event. Is there a way to do that?

windows-uwp
10 |1000 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

pesmith avatar image
0 Votes"
pesmith answered ·

The OS will detect that the outer socket has been closed and will automatically restart (you'll get a new connect call).

· 2 · Share
10 |1000 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

This is not that I am getting. In my case after receiving RST from peer side flow of packets just stops. No new connection attempts detected by wireshark. VpnPlugin::Disconnect() and VpnPlugin::Connect() also not called automatically. The only way to restore tunnel is to manually trigger VpnManagementAgent().DisconnectProfileAsync() and VpnManagementAgent().ConnectProfileAsync() from controlling frontend app.


I don't see a way the OS by itself reestablish tunnel connection (because of specific protocols and authentication), so OS must restart VPN plugin by trigger VpnPlugin::Disconnect() and VpnPlugin::Connect() sequence or should inform VpnPlugin by any other means about loss of tunnel connection.


My system is running Win 10 Pro 1909.


0 Votes 0 · ·
RoyLi-MSFT avatar image RoyLi-MSFT AlexanderSbitnev-4464 ·

I'm sorry to say that currently, we could offer limited help with VPN. For the VPN issue, Tt needs more professional support. I suggest that you might need to open a support ticket for this. Please contact our paid phone support at MS Support. You will get 1:1 support on that. Please kindly note that your support ticket will be free if it is Microsoft's issue.


0 Votes 0 · ·