WCF Best Practice / Config for Streaming Loading

I am creating a service that will download files from the server. I have limited knowledge in this area and please report on the service settings.

I ruled out full file buffering due to memory usage which would affect the server.

What is the best binding to use in WCF to securely load streaming traffic? wsHttpBinding, basicHttpBinding, netTcpBinding, etc.

and if it weren't for too many problems, you could write a few lines that says why your answer matches the functions correctly? (so I'll find out from the answer)



(currently working on Vs2008)

And what is the best format to receive information for android use?

Update * Additional Information: File sizes: 1 MB to 1 GB, multiple downloads at the same time.

What WCF configurations should I use to achieve this functionality?


source to share

1 answer

Not streaming mode . For most people familiar with WCF, NetTcp with TransferMode.Streamed will be told, however, this presents serious performance issues. Streaming will allow you to accommodate more concurrent downloads as it will not load server memory, but WCF has block size independent of override, it slows down downloads, a file over 100MB will be significantly slower than any other methods.

I suggest the chunking method method like

byte[] GetBytes(int chunkNumber);


On the client side, you can stitch the chunks together at boot. Use HttpBinding for interoperability as everything you pass is bytes which won't incur too much NetTcp binding overhead.



All Articles