Prioritizing File Transfers

One typical requirement for many applications today is the ability to transfer files between the local system and a remote server, and the File Transfer Protocol (FTP) and Hyptertext Transfer Protocol (HTTP) are the two most commonly used Internet protocols for this purpose. SocketTools has components that support both of these protocols, making it a simple task to integrate this functionality into your own software.

Not all applications have the same needs when it comes to the resource and bandwidth utilization on the local system. In some cases, developers want the data transferred as quickly as possible, regardless of how much network bandwidth they consume. Other programs are designed to run in the background or as a service and need to use very little bandwidth and system resources.

With SocketTools, you have the ability to specify transfer priorities. This determines how system resources and network bandwidth should be allocated for the transfer. For the libraries, the transfer priority is set by calling the FtpSetPriority or HttpSetPriority functions. For the .NET classes and ActiveX controls, you can set the Priority property. There are five priority levels which control the transfer rate:

Normal Priority
This is the default priority, and is designed to provide a balance between the file transfer rate and the system resources allocated for the transfer. In most cases, this is the appropriate priority for an interactive user application. At this priority, the transfer won’t interfere with other applications running on the system, either in terms of CPU utilization or network bandwidth.

Background Priority
This priority specifies that the transfer is taking place in the background and should be given a very low priority. At this priority level the CPU utilization is minimal and very little network bandwidth is consumed. The trade-off is that the transfer will take much longer to complete. This priority should be used if low resource utilization is required, and the amount of time to complete the transfer is not important. This priority is not recommended for interactive applications where the user must wait for the transfer to complete.

Low Priority
This priority specifies that the transfer should use less memory and reduce the network bandwidth utilization. It is not as restrictive as a background priority transfer, and is generally recommended for applications that are performing multiple, simultaneous transfers. This will minimize the impact on other applications that are running on the system.

High Priority
This priority specifies that additional system resources should be allocated for the transfer, and there should be no limitations on network bandwidth utilization. High priority transfers typically require more memory, have increased CPU utilization and consume more network bandwidth. Interactive programs that require the transfer to complete quickly can use this priority to increase the overall transfer rate.

Critical Priority
This priority specifies that the transfer must complete as quickly as possible, without regard for system resource allocation or network bandwidth. With critical priority transfers, no events are generated and Windows messages will not be processed. It is important to note that if you specify this priority level in the main UI thread of an application, it can effectively cause the program to appear to be non-responsive to the user. Use of this priority can also negatively impact the performance of other applications running on the system, both in terms of CPU utilization and the amount of network bandwidth that is consumed during the transfer.

The ability to specify a priority gives your application additional flexibility and control over the transfer process. For more information about setting transfer priorities, you can refer to the documentation that is included with your copy of SocketTools.

Share This