Back to product page

PeerConnecting event


Fires when remote peer wants to connect.

Type

Boolean value.

Syntax

  • C++
bool PeerConnecting(CVPN *vpn, CP2P *p2p, char *peerName, char *peerAddrs);
The PeerConnecting(vpn,p2p,peerName,peerAddrs) syntax has these parts:
vpnPointer to devVPN instance that fired the event.
p2pPointer to devP2P instance that wants to connect.
peerNameName of the peer that wants to connect.
peerAddrsVirtual IP address of the peer that you can use to access the peer.
Return valueReturn True if you accept the connection with the peer.

Remarks

After Search method is called, and mediator finds a match, this event will be fired so you can decide if you want to connect with this peer. If you want to connect, return True, and connection will be accepted.

After connection is (successfully) established, PeerConnected event will be fired.

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

Platforms

Windows
Mac OSX
Linux
BSD
iPhone IOS