Ryan Britton - 430 - Jun 16, 2014

(moved to correct Forum)

Ryan Britton:

now that I’ve changed the code to use PostAsync, the only notable difference I can see in the example you provided is that its using GetAsync where I am using PostAsync…could that have something to do with it? Surely not?

I’ve added a POST example which works the same as GET: 
https://github.com/ServiceStack/ServiceStack/commit/8ae7e8459180255bcccec0c57bdcbee11f82d828

FYI, I’ve expanded the tests to include different scenarios:
https://github.com/ServiceStack/ServiceStack/blob/master/tests/ServiceStack.WebHost.Endpoints.Tests/AsyncProgressTests.cs
TestProgressService:
https://github.com/ServiceStack/ServiceStack/blob/master/tests/ServiceStack.WebHost.IntegrationTests/Services/TestProgressService.cs

In all cases the callback fires, but in a few of them the ContentLength was unknown and so the total was coming back as -1. I’ve expanded ServiceStack to set the ContentLength where possible in this commit:
https://github.com/ServiceStack/ServiceStack/commit/028428c412697108414f970576e26ac495f50c00

With this commit all the SelfHosting async progress tests pass. The ASP.NET development server doesn’t let you set the ContentLength so a few of progress tests will fail with an unknown length, marked with Explicit here: 
https://github.com/ServiceStack/ServiceStack/blob/master/tests/ServiceStack.WebHost.IntegrationTests/Tests/AsyncProgressTests.cs#L57

This change is now on MyGet:
https://github.com/ServiceStack/ServiceStack/wiki/MyGet

One thing that you might need to be aware of is that the BufferSize determines the granularity of the callbacks as it executes the callback once the buffer gets full. By default the BufferSize is 8192 byes.