WaitNet Statement

Wait for TCP/IP port connection to be established.

Syntax
WaitNet #portNumber [, timeOut]

Parameters

portNumber
Specify the number of the TCP/IP port to wait for connections, as an integer value from 201 to 216.
timeOut
Optional. Maximum time to wait for connection.

See Also
OpenNet, CloseNet

WaitNet Statement Example
For this example, two controllers have their TCP/IP settings configured as follows:

Controller #1:
Port: #201
Host Name: 192.168.0.2
TCP/IP Port: 1000

Function tcpip
  OpenNet #201 As Server
  WaitNet #201
  Print #201, "Data from host 1"
Fend

Controller #2:
Port: #201
Host Name: 192.168.0.1
TCP/IP Port: 1000

Function tcpip
  String data$
  OpenNet #201 As Client
  WaitNet #201
  Input #201, data$
  Print "received '", data$, "' from host 1"
Fend