aiocoap icon indicating copy to clipboard operation
aiocoap copied to clipboard

Use initial block number specified in Block2 request

Open wbober opened this issue 9 years ago • 3 comments

This PR allows the client to specify initial block number that should be transmitted. This is useful in a case when the client is resuming the request for some reason (a reset for example).

wbober avatar Sep 28 '16 09:09 wbober

I might be wrong, but AFAICT this would always fail because block message assembly assumes it starts at 0. Do you have a code example that would actually make use of this? (I'd need one for the unit tests anyway.)

chrysn avatar Nov 17 '16 09:11 chrysn

Are you referring to message assembly in aiocoap? I haven't looked into that, so you might be right. I'm using an in-house COAP client running on an embedded device. The scenario that download restarts from non-zero block is not that uncommon, hence the PR.

wbober avatar Nov 21 '16 09:11 wbober

if you do blockwise yourself, the application should return False to the resource's needs_blockwise_assembly async method (possibly that should be simplifyed so a class attribute .needs_bockwise_assembly=False or similar can be set); then the server-side block handling code, including the patched line, will not be used.

does that work for your use case?

chrysn avatar Nov 22 '16 09:11 chrysn