
SearchStart event
Fires when search has started.
Syntax
- C#
- C++
- VB.NET
delegate void devP2P.SearchStartEvent(IntPtr Handle, int binds);
The SearchStart(Handle,binds) syntax has these parts:
The SearchStart(Handle,binds) syntax has these parts:
Handle | Reference to the devP2P instance. |
binds | Custom bind parameters passed to remote peer. |
void SearchStart(CP2P *p2p, char *binds);
The SearchStart(p2p,binds) syntax has these parts:
The SearchStart(p2p,binds) syntax has these parts:
p2p | Pointer to devP2P instance that fired the event. |
binds | Custom bind parameters passed to remote peer. |
Delegate Sub P2P_SearchStartEvent(ByVal Handle As IntPtr, ByVal binds As Integer)
The SearchStart(Handle,binds) syntax has these parts:
The SearchStart(Handle,binds) syntax has these parts:
Handle | Reference to the devP2P instance. |
binds | Custom bind parameters passed to remote peer. |
Remarks
This event is fired after you call Start method, allowing you to specify custom bindip parameters - list of local IP/Port points where user can try to connect. It will already contain a list like this:T192.168.1.1 1024
U192.168.1.1 23234
T1.2.3.4 2344
U1.2.3.4 32532
etc.. It is a list of local interfaces where devP2P listens for remote peer's connection. If UPNPinit was called, and UPNP is available on your system, this list can also contain external IP address on your router where devP2P managed to open a port that will forward back to it. However, if you're aware that some other IP/Port also points to your devP2P instance, you can add it here, line by line - starting with 'T' for TCP, 'U' for UDP, and then following with IP, one space, port, and newline.
To use this event, you should implement function by yourself in the code (based on function declaration), and set devP2P.Events.SearchStart structure member to point to your function.
Code sample
- C++
void p2p_SearchStart(devP2Plib::CP2P *p2p, char *binds)
{
printf("%s] started searching for %s at %s (%d)\r\n", p2p->MyName, p2p->PeerName, p2p->MediatorAddress, p2p->MediatorPort);
}
int main(int argc, char **argv)
{
/* ... */
devP2Plib::CP2P *p1 = devP2Plib::CP2P::Create();
/* ... */
p1->Events.SearchStart = p2p_SearchStart;
/* ... */
}
{
printf("%s] started searching for %s at %s (%d)\r\n", p2p->MyName, p2p->PeerName, p2p->MediatorAddress, p2p->MediatorPort);
}
int main(int argc, char **argv)
{
/* ... */
devP2Plib::CP2P *p1 = devP2Plib::CP2P::Create();
/* ... */
p1->Events.SearchStart = p2p_SearchStart;
/* ... */
}
Platforms
WindowsMac OSX
Linux
BSD