RelayConnected Event
    
 

Description

Fires when UDP relay receives first packet from one peer.

Syntax

Private Sub object_RelayConnected(Relay, IP, Port, ID)

The RelayConnected Event syntax has these parts:

PartDescription
objectA wodVPN object.
RelayA VPNRelay object. Reference to relay that is connected.
IPA String value. IP address where peer is coming from.
PortA Long value. Port peer is coming from.
IDA String value. ID set by the peer, if known.

Remarks

RelayConnected event will fire when first packet is received from one of the peers. As you expect, two RelayConnected events should be fired (one for each peer) in order for connection between peers to be successful. You can use event arguments to determine if you will accept the peer or not. If you don't wish to accept the peer, there's not much you can do except to close the relay, since relays are using UDP packets and you cannot prevent yourself from receiving packets from that peer.

You can, however, set LeftIP/RightIP/LeftPort/RightPort properties before (or even during) connection occurs. When those values are known, wodVPN will ignore all other packets anyway. However, if you set those properties, this event will never fire since peer is known already.

ID value will be known only if you set the Password property, and it is set to the same password used by peers.