close

close();

The close method of the TcpIpConnection class closes a connection to a remote application and returns when the connection is closed. This method can be called when the connection is in any state. The following example shows the use of the close method to unload the form and close the connection if TCP/IP has been left in connection state.

buttonUnload_click(btn: Button input) updating;
begin
    // If a connection is present, closes the connection
    if self.tcp.state = Connection.Connected then
        self.tcp.close;
    endif;
    self.unloadForm;
end;