-
Notifications
You must be signed in to change notification settings - Fork 120
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Get all partial packages received instead of discarding them? #312
Comments
Just to clarify: The embedded client sends a block-wise request with a large request body that gets fragmented. The CoAP server is implemented in aiocoap, and is supposed to process what has been received. Is that right? If so, there are two avenues:
|
The use case you describe is exactly right. I am investigating solution number 2. If a block wise transfer is ongoing from client -> server, when does the server stop listening for the new messages - what part of the code schedules this? |
If a block wise transfer is ongoing from client -> server, when does
the server stop listening for the new messages - what part of the code
schedules this?
The timeouts are implemented in aiocoap.blockwise.Block1Spool, whose
assemblies is a aiocoap.util.asyncio.timeoutdict with a timeout of
MAX_TRANSMIT_WAIT.
If you want to manage the timeouts yourself, implementing a custom
Block1Spool-ish type may be practical.
It'd likely not be based on TimeoutDict, but rather on a custom managed
structure that produces an incomplete request message rather than
dropping it; if it is combined with a custom render_to_pipe
implementation, it can still send the partial message on to the handler.
I recommend that that message retain some Block1 option value, by which
the handler can distinguish it from fully assembled messages. The Block1
value may be technically invalid (eg. 0/1/1024 when the payload is 9KiB
long), but no part in aiocoap will take offense, and the handler can
then correctly grasp that this message represents an incomplete
block-wise request that has been partially reassembled.
|
Hi,
I'm sending a large message from an embedded client. If I only eg. get, lets say 9 out of 10 messages through, all packages will get lost due to a retransmission timeout. What will be the best way to catch a timeout exception and retrieve the received bytes before the message gets released from memory?
The text was updated successfully, but these errors were encountered: