Back to product page

FileSend event


Fires when local devP2P starts sending file to remote.

Type

Boolean.

Syntax

  • C#
  • C++
  • VB.NET
delegate bool devP2P.FileSendEvent(IntPtr Handle, int chanid, string filename, Int64 size);
The FileSend(Handle,chanid,filename,size) syntax has these parts:
HandleReference to the devP2P instance.
chanidIndex of the channel where file is being transferred.
filenamePath to the local file.
sizeLong integer, total size of the file that will be sent.
Return valueReturn true if you accept file to be sent. Return false to cancel the transfer.

bool FileSend(CP2P *p2p, int chanid, char *filename, int64 size);
The FileSend(p2p,chanid,filename,size) syntax has these parts:
p2pPointer to devP2P instance that fired the event.
chanidIndex of the channel where file is being transferred.
filenamePath to the local file.
sizeLong integer, total size of the file that will be sent.
Return valueReturn true if you accept file to be sent. Return false to cancel the transfer.

Delegate Function P2P_FileSendEvent(ByVal Handle As IntPtr, ByVal chanid As Integer, ByVal filename As String, ByVal size As Int64) As Boolean
The FileSend(Handle,chanid,filename,size) syntax has these parts:
HandleReference to the devP2P instance.
chanidIndex of the channel where file is being transferred.
filenamePath to the local file.
sizeLong integer, total size of the file that will be sent.
Return valueReturn true if you accept file to be sent. Return false to cancel the transfer.

Remarks

FileSend event fires as result of SendFile call. If all is ok on local side, this event will fire so you can get basic idea about the transfer that will be performed. If remote side accepts it (it receives FileReceive event), one or more FileProgress events will be fired as file is being transferred. When transfer finishes, FileDone will fire.

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

Code sample

  • C++

Platforms

Windows
Mac OSX
Linux
BSD