listen

listen();

The listen method of the Connection class listens for an external application to connect to JADE and returns when a connection is established. The listen method can be called only when the state property is Disconnected (0).

Each subclass of the Connection class must provide any properties that are required to define the connection; for example, the name, port, and so on. The state property changes to Connected (2) when the listen method completes.

The code fragment in the following example sets the connection to listen to the current port, sets the status bar to read connected, and fills the text box with the name information if a connection is made.

self.connection.listen;
if self.connection.state = Connection.Connected then
    statusLine1.caption := "Connected";
    textBox.text        := self.connection.name;
endif;
...

See also the Connection class timeout property.