Back to product page

FileProgress event


Fires during file transfer.

Syntax

  • C#
  • C++
  • VB.NET
delegate void devP2P.FileProgressEvent(IntPtr Handle, int chanid, Int64 position, Int64 size);
The FileProgress(Handle,chanid,position,size) syntax has these parts:
HandleReference to the devP2P instance.
chanidIndex of the channel where file is being transferred.
positionCurrent transfer position.
sizeTotal size that will be transferred.

void FileProgress(CP2P *p2p, int chanid, int64 position, int64 size);
The FileProgress(p2p,chanid,position,size) syntax has these parts:
p2pPointer to devP2P instance that fired the event.
chanidIndex of the channel where file is being transferred.
positionCurrent transfer position.
sizeTotal size that will be transferred.

Delegate Sub P2P_FileProgressEvent(ByVal Handle As IntPtr, ByVal chanid As Integer, ByVal position As Int64, ByVal size As Int64)
The FileProgress(Handle,chanid,position,size) syntax has these parts:
HandleReference to the devP2P instance.
chanidIndex of the channel where file is being transferred.
positionCurrent transfer position.
sizeTotal size that will be transferred.

Remarks

This event fires during file transfer, both when file is being sent and received. You can monitor it's progress and check current Bandwidth if you are interested in transfer speed. When transfer finishes, FileDone will be fired.

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

Code sample

  • C++

Platforms

Windows
Mac OSX
Linux
BSD