From Xojo Documentation
Used to securely open and close ports on the Xojo Cloud firewall for when you need to connect to an outside service. As long as an instance to the object exists, the port remains open. If the object goes out of scope, is destroyed (set to Nil), or the app terminates, the firewall port is automatically closed.
By default, the firewall on your Xojo Cloud server blocks all connections (other than port 80 and port 443) coming into and going out of the system unless a specific exception has been created. The problem with most firewall exceptions is that they are permanent, and because the are not created by the programmer that needs them, when they are no longer needed the exception is not removed and you end up with a security hole. Xojo Cloud solves this problem by using dynamic firewall port allocation. That is, you only open ports when you need them and they automatically close when you don't need them any more.
These are the values for the FirewallPort.Direction enumeration:
|Incoming||Allow incoming data from the specified port.|
|Outgoing||Allow outgoing data to the specified port.|
This code opens firewall port 587: