event StateChanged (oldState as StateEnum, newState as StateEnum)
Fired when the connection's state is changing.

TypeDescription
oldState as StateEnum A StateEnum expression that indicates the state of the connection before changing its state.
newState as StateEnum A StateEnum expression that indicates the current state. 

Use the StateChanged event to notify your application when the connection's state was changed.