article

[Binary Transfer Control OCX Updated version with File I/O Error solved] Extremely fast

Email
Submitted on: 1/27/2015 9:24:00 AM
By: Kenny Lai, Lai Ho Wa (from psc cd)  
Level: Advanced
User Rating: By 20 Users
Compatibility: VB 6.0
Views: 1460
 
     

[Binary Transfer Control OCX] Extremely fast, almost NO MEMORY USE, reliable, as easy to use as an ordinary Winsock control. Every network programmer must use, and every one must see!

This is an OCX version of a completely new binary transfer engine. It sends a 244MB file in 71 seconds and I can still work on another VB IDE without effort! The sender control read-and-send one chunk only for each time, using the same array of a chunk size (Optimum is 4096 bytes). Once the receiver control receive the bytes, it builds up the file immediately. It's hard-drive and CPU intensive, but using almost no memory! (You can monitor the memory usage while sending file.)



 
				

[Binary Transfer Control OCX] Extremely fast, almost NO MEMORY USE, reliable, as easy to use as an ordinary Winsock control. Every network programmer must use, and every one must see!

This is an OCX version of a completely new binary transfer engine. It sends a 244MB file in 71 seconds and I can still work on another VB IDE without effort! The sender control read-and-send one chunk only for each time, using the same array of a chunk size (Optimum is 4096 bytes). Once the receiver control receive the bytes, it builds up the file immediately. It's hard-drive and CPU intensive, but using almost no memory! (You can monitor the memory usage while sending file.)


Last time I upload a sample to upload file using multiple winsocks and arrays and collection of bytes. The speed is about 1600KBps. But many people complain about the memory usage that store all the bytes of a large file. 

This time I have changed my mind. I use chunks only, with DoEvents in all FileIO and sending work. The sender read a chunk from file and send it immediately, while the reader build up the bytes to the target file once it get the bytes.

The speed is awesome. The top speed while sending the Office 2000 Disc 1 zip file(244 MB) is >4200KBps (32.8125Mbps). This meet the industrial standard (The maximum capacity of a small-business server is about 45Mbps, but the server administrator will definitely not allow one client to draw all the bandwidth.

The zip file contain two part. The files in the top directory is a User-Control test that I used to build the control for debug. The OCXs and Test project is inside the OCX Test directory. There's an OCX included, and the BinaryTransferOCXTest.exe use the reference of the BinaryTransferControl.ocx.

Using standalone OCX has an advantage that it uses multithread. The entire program will not be affected while the control is busing sending files. (REMARK: If you test the program on local-to-local with very large, >300MB files, the program itself may be affected as it draw all the CPU and HardDrive power to transfer and receive bytes. But in real situation, the CPU and HardDrive effort is directly depend on the network speed. That mean the engine draw and send and build up bytes ONLY when the last bytes is sent or received.)

The demonstration program in the OCX Test directory(BinaryTransferOCXTest.vbp) is well written and run smoothly. (As the screenshot show, it sends the Office2000 Disc 1 in ZIP effortlessly.) PLEASE FOLLOW THE ORDER OF CALLING METHOD STRICTLY ACCORDING TO THE DEMONSTRATION, AS THE METHODS AND EVENTS ARE HIGHLY INTERDEPENDENT!

Finally, please vote my work and give any comments, and critics.

Thank you for reading this long long article.

Kenny Lai

http://pcseries.sourceforge.net/pscode/BinaryTransferControl.zip


Other 12 submission(s) by this author

 


Report Bad Submission
Use this form to tell us if this entry should be deleted (i.e contains no code, is a virus, etc.).
This submission should be removed because:

Your Vote

What do you think of this article (in the Advanced category)?
(The article with your highest vote will win this month's coding contest!)
Excellent  Good  Average  Below Average  Poor (See voting log ...)
 

Other User Comments


 There are no comments on this submission.
 

Add Your Feedback
Your feedback will be posted below and an email sent to the author. Please remember that the author was kind enough to share this with you, so any criticisms must be stated politely, or they will be deleted. (For feedback not related to this particular article, please click here instead.)
 

To post feedback, first please login.