Back to product page

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:
HandleReference to the devP2P instance.
bindsCustom bind parameters passed to remote peer.

void SearchStart(CP2P *p2p, char *binds);
The SearchStart(p2p,binds) syntax has these parts:
p2pPointer to devP2P instance that fired the event.
bindsCustom 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:
HandleReference to the devP2P instance.
bindsCustom 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++

Platforms

Windows
Mac OSX
Linux
BSD