Listen Method


Listens for incoming TCP connections.

Return Type

A Long value. 


object.Listen RemoteID

The Listen Method syntax has these parts:

objectAn expression evaluating to an object of type TCPHandler.
ID Required. A String value. ID of the remote peer you're expecting to connect.


The Listen method will put TCPHandler in listening state - allowing remote peer to connect using Connect method. You can call Listen method on both sides, and then call also Connect on both sides - trying to connect to each other.


RemoteID argument ensures only expected peer can connect. When incoming connection arrives, TCPConnected event will fire.


This method will return local TCP port used for listening. If you did not set LocalTCPPort prior to calling this method, new free port will be assigned.