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

From Xojo Documentation

Revision as of 15:54, 18 July 2019 by Gperlman (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Constructor

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

Use to securely open and close ports in a Xojo Cloud firewall.

Notes

Port: The port you wish to connect to (outgoing) or listen on (incoming). If you are creating an incoming connection, remember that you can't listen on a port < 1024 (they are reserved for system services). Ports 54320 through 54329 are reserved for use by Xojo for both incoming and outgoing connections. Use of these ports will result in an OutOfBoundsException.

DataDirection: The direction the initial data will be flowing. If your app will be connecting to an outside service, direction = XojoCloud.FirewallPort.Direction.Outgoing. If your app (or a helper app) will be listening on the port, DataDirection = XojoCloud.FirewallPort.Direction.Incoming.

Sample Code

This code opens firewall port 587:

Var 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