Back to product page

Stopped event


Fires when devP2P stops working and goes offline.

Syntax

  • C#
  • C++
  • VB.NET
delegate void devP2P.StoppedEvent(IntPtr Handle, int errorno);
The Stopped(Handle,error) syntax has these parts:
HandleReference to the devP2P instance.
errorErrors value, ErrorNone if operation is successful, or other value defining the error that occurred.

void Stopped(CP2P *p2p, Errors error);
The Stopped(p2p,error) syntax has these parts:
p2pPointer to devP2P instance that fired the event.
errorErrors value, ErrorNone if operation is successful, or other value defining the error that occurred.

Delegate Sub P2P_StoppedEvent(ByVal Handle As IntPtr, ByVal errorno As Integer)
The Stopped(Handle,error) syntax has these parts:
HandleReference to the devP2P instance.
errorErrors value, ErrorNone if operation is successful, or other value defining the error that occurred.

Remarks

This event fires when devP2P stops it's operation and goes offline, no matter if it was previously Connected to remote peer or not. If it stopped due to an error, Error argument will provide info about the error. If it was result of your call to Stop method, Error will be empty. You should now call Start method again to accept new connections.

When devP2P successfully connects to remote peer, you cannot reuse same devP2P instance, so there is no Disconnect method in devP2P. If you decide you want to reconnect, you must use new devP2P instance (or Stop/Start current one) so internal buffers are cleared. Otherwise, devP2P could be left in unknown state - dealing with mediator, local UDP/TCP listening sockets etc..

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

Code sample

  • C++

Platforms

Windows
Mac OSX
Linux
BSD