BackgroundTransferService: what are some of the details of its operation?
I kick off 5 uploads (of varying size) via the BackgroundTransferService. I have the following questions about the way it works:
- It seems that on the emulator it does 2 uploads at a time. Is this how it works on the actual device? Can I programmatically change this开发者_C百科 behavior?
- Can I count on the uploads going out in the order that I submitted them? I seem to be getting conflicting results in my testing.
- When I inspect the BackgroundTransferService in my application, does it contain requests from other apps as well or just mine?
- Do I need to reconnect events for all the BackgroundTransferRequest objects when coming back from being tombstoned? What about coming back from being reactivated?
- Do I need to disconnect events from the BackgroundTransferRequest when I remove it from the BackgroundTransferService.Requests collection?
- When I try to upload a non-existing URL:Port (on the localhost), the TransferStatus is reported as WaitingForNonVoiceBlockingNetwork. The upload never actually completes/fails. Is this how it is on the device? Should I remove the request when it encounters this TransferStatus?
You cannot influence the behaviour of the BTS. If you don't like the way it works you can write the transfer functionality as part of your own application but then you have to handle running in the background yourself.
There is no guarantee on sequence.
The BTS may be handling requests from other apps but you won't be able to see the details.
Requests()
will only return details for your app.Surely a quick test will tell you this.
It's good practice to.
Have you checked the
TransferError
property whe you reach this situation? This is a perfectly valild status in other situations and so you shouldn't treat this as a automatic fail.
精彩评论