FirewallPort

From Xojo Documentation
Jump to: navigation, search

Class (inherits from Object)

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.

Properties
IsOpen NetworkInterface


Methods
Close Open


Constructors

FirewallPort.Constructor(Port As Integer, DataDirection As XojoCloud.FirewallPort.Direction)


Notes

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:

Value Description
Incoming Allow incoming data from the specified port.
Outgoing Allow outgoing data to the specified port.

Example

This code opens firewall port 587:

Dim fwp As New XojoCloud.FirewallPort(587, XojoCloud.FirewallPort.Direction.Outgoing)
fwp.Open() // This call is synchronous
If fwp.isOpen() Then
// Do what you need to do
fwp.Close() // Optional, but if you will not using the port, we recommend it.
End If
Personal tools
Namespaces

Variants
Actions
Main
Content
Starting Out
Dig Deeper
More Help
Toolbox
About