RelayConnected Method
      
 

Description

Called when byte data message arrives from remote side.

Return Type

None  

Syntax

object.RelayConnected Owner, Relay, IP, Port, ID

The RelayConnected Method syntax has these parts:

PartDescription
objectAn expression evaluating to an object of type IwodVPNNotify.
Owner A wodVPNCom object. Reference to the wodVPNCom instance that called this notification method.
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

This method is called only if you have implemented the IwodVPNNotify interface in your application and the wodVPN1.Notification property has received a reference to an instance of your implementation.

RelayConnected notification method will be called when first packet is received from one of the peers. As you expect, two RelayConnected method should be called (one for each peer) in order for connection between peers to be successful. You can use method 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.