TCPConnected Event
    
 

Description

Fires when TCP handler connects to remote peer, or to mediator.

Syntax

Private Sub object_TCPConnected(RemoteID)

The TCPConnected Event syntax has these parts:

PartDescription
objectA wodVPN object.
RemoteIDA String value. Holds ID of remote peer.

Remarks

TCPConnected event is fired as result of Listen or Connect methods. When connection is successfully established with remote peer, this event fires, and RemoteID argument holds ID of the peer. If RemoteID is empty, it means you have successfully connected to TCP Relay, but relay did not yet establish communication with remote peer. It is possible for this event to fire twice - first with RemoteID empty (connected to TCP Relay), and second time with RemoteID set to peer's ID.

 

Once connection is established, TCPHandler will stop listening for additional connections. Only one connection can be made at a time between you and remote peer.


When connection is closed, TCPDisconnected event is fired.