
ForwardClose event
Fires when forwarding is stopped.
Syntax
- C#
- C++
- VB.NET
delegate void devP2P.ForwardCloseEvent(IntPtr Handle, int forwardid, int errorno);
The ForwardClose(Handle,forwid,error) syntax has these parts:
The ForwardClose(Handle,forwid,error) syntax has these parts:
Handle | Reference to the devP2P instance. |
forwid | Index of the forwarded channel. |
error | Errors value, ErrorNone if operation is successful, or other value defining the error that occurred. |
void ForwardClose(CP2P *p2p, int forwid, Errors error);
The ForwardClose(p2p,forwid,error) syntax has these parts:
The ForwardClose(p2p,forwid,error) syntax has these parts:
p2p | Pointer to devP2P instance that fired the event. |
forwid | Index of the forwarded channel. |
error | Errors value, ErrorNone if operation is successful, or other value defining the error that occurred. |
Delegate Sub P2P_ForwardCloseEvent(ByVal Handle As IntPtr, ByVal forwardid As Integer, ByVal errorno As Integer)
The ForwardClose(Handle,forwid,error) syntax has these parts:
The ForwardClose(Handle,forwid,error) syntax has these parts:
Handle | Reference to the devP2P instance. |
forwid | Index of the forwarded channel. |
error | Errors value, ErrorNone if operation is successful, or other value defining the error that occurred. |
Remarks
This event is fired when specific forwarding closes. At this moment, all users that were using this channel are disconnected from devP2P.To use this event, you should implement function by yourself in the code (based on function declaration), and set devP2P.Events.ForwardClose structure member to point to your function.
Code sample
- C++
void p2p_ForwardClose(devP2Plib::CP2P *p2p, int forwid, devP2Plib::Errors error)
{
printf("%s] Forward close 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.ForwardClose = p2p_ForwardClose;
/* ... */
}
{
printf("%s] Forward close 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.ForwardClose = p2p_ForwardClose;
/* ... */
}
Platforms
WindowsMac OSX
Linux
BSD