Catalyst File Transfer .NET

FileTransfer.ActivePorts Property

Gets and sets the port numbers used for active mode file transfers.

[Visual Basic]
Public Property ActivePorts As PortRange
[C#]
public FileTransfer.PortRange ActivePorts {get; set;}

Property Value

A PortRange structure which specifies the minimum and maximum port numbers used for active mode file transfers.

Remarks

This property is used to change the default port numbers used for active mode file transfers. Active mode is used when the Passive property is set to false. Instead of the client establishing an outbound connection to the server for the file transfer, it listens for an inbound connection from the server back to the client. In most cases, passive mode transfers are preferred because they mitigate potential compatibility issues with firewalls and NAT routers.

If active mode transfers are required, the default port range used when listening for the server connection is between 1024 and 5000. This is the standard range of ephemeral ports used by the Windows operating system. However, under some circumstances that range of ports may be too small, or a firewall may be configured to deny inbound connections on ephemeral ports. In that case, the ActivePorts property can be used to specify a different range of port numbers.

While it is technically permissible to assign the low and high port numbers to the same value, effectively specifying a single active port number, this is not recommended as it can cause the transfer to fail unexpectedly if multiple file transfers are performed. A minimum range of at least 1000 ports is recommended. For example, if you specify a low port value of 40000 then it is recommended that the high port value be at least 41000. The maximum port value is 65535.

See Also

FileTransfer Class | SocketTools Namespace | PortRange Structure