StateChange Event
    
 

Description

Fires when wodVPN changes its state.

Syntax

Private Sub object_StateChange(OldState)

The StateChange Event syntax has these parts:

PartDescription
objectA wodVPN object.
OldStateA StatesEnum enumeration, as described in settings. Holds the previous state.

Settings

The settings for OldState are:

ConstantValueDescription
 Disconnected0Disconnected from remote peer.
 Listening1Listening for incoming connections.
 Searching2Searching for remote peer.
 Linking3Linking with remote peer (trying to find UDP hole).
 Connecting4Connecting with remote peer.
 Disconnecting5Disconnecting from remote peer.
 Connected6Connected to remote peer.

Remarks

StateChange event is fired each time wodVPN changes its internal state. Initially it is set to Disconnected, but as you call wodVPN's methods it will be changed to Listening, Connecting etc..

Using this event you can determine whether there is anything happening with wodVPN. You can access current state using State property.