Back to product page

StateChange event


Fires when devP2P changes its state.

Syntax

  • C#
  • C++
  • VB.NET
delegate void devP2P.StateChangeEvent(IntPtr Handle, int state);
The StateChange(Handle,state) syntax has these parts:
HandleReference to the devP2P instance.
stateStates value. Current state.

void StateChange(CP2P *p2p, States state);
The StateChange(p2p,state) syntax has these parts:
p2pPointer to devP2P instance that fired the event.
stateStates value. Current state.

Delegate Sub P2P_StateChangeEvent(ByVal Handle As IntPtr, ByVal state As Integer)
The StateChange(Handle,state) syntax has these parts:
HandleReference to the devP2P instance.
stateStates value. Current state.

Remarks

StateChange event is fired each time devP2P changes its internal state. Initially it is set to StateDisconnected, but as you call devP2P's methods it will be changed to StateListening, StateLinking etc..

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

To use this event, you should implement function by yourself in the code (based on function declaration), and set devP2P.Events.StateChange structure member to point to your function.

Code sample

  • C++

Platforms

Windows
Mac OSX
Linux
BSD