
FileDone event
Fires when file transfer completes.
Syntax
- C#
- C++
- VB.NET
delegate void devP2P.FileDoneEvent(IntPtr Handle, int chanid, int errorno);
The FileDone(Handle,chanid,error) syntax has these parts:
The FileDone(Handle,chanid,error) syntax has these parts:
Handle | Reference to the devP2P instance. |
chanid | Index of the channel where file is being transferred. |
error | Errors value, ErrorNone if operation is successful, or other value defining the error that occurred. |
void FileDone(CP2P *p2p, int chanid, Errors error);
The FileDone(p2p,chanid,error) syntax has these parts:
The FileDone(p2p,chanid,error) syntax has these parts:
p2p | Pointer to devP2P instance that fired the event. |
chanid | Index of the channel where file is being transferred. |
error | Errors value, ErrorNone if operation is successful, or other value defining the error that occurred. |
Delegate Sub P2P_FileDoneEvent(ByVal Handle As IntPtr, ByVal chanid As Integer, ByVal errorno As Integer)
The FileDone(Handle,chanid,error) syntax has these parts:
The FileDone(Handle,chanid,error) syntax has these parts:
Handle | Reference to the devP2P instance. |
chanid | Index of the channel where file is being transferred. |
error | Errors value, ErrorNone if operation is successful, or other value defining the error that occurred. |
Remarks
FileDone fires when transfer completes and file is received (or sent) by the beer. Error argument will contain possible error if transfer failed. From now channel that was used for the transfer is freed and you can use it for some other operation.To use this event, you should implement function by yourself in the code (based on function declaration), and set devP2P.Events.FileDone structure member to point to your function.
Code sample
- C++
void p2p_FileDone(devP2Plib::CP2P *p2p, int chanid, devP2Plib::Errors error)
{
printf("%s] Transfer completed with error %d %s\r\n", p2p->MyName, error, p2p->ErrorText(error));
}
int main(int argc, char **argv)
{
/* ... */
devP2Plib::CP2P *p1 = devP2Plib::CP2P::Create();
/* ... */
p1->Events.FileDone = p2p_FileDone;
/* ... */
}
{
printf("%s] Transfer completed with error %d %s\r\n", p2p->MyName, error, p2p->ErrorText(error));
}
int main(int argc, char **argv)
{
/* ... */
devP2Plib::CP2P *p1 = devP2Plib::CP2P::Create();
/* ... */
p1->Events.FileDone = p2p_FileDone;
/* ... */
}
Platforms
WindowsMac OSX
Linux
BSD