Proper way to use immediate data transmission for streams: Waiting in picoquic_prepare_to_send needed? How immediate is immediate? #2043
Mike-RandoNumber
started this conversation in
General
Replies: 1 comment 2 replies
-
|
You certainly do not want to "wait for data" -- that would be exactly the "sit on the callback" issue. The application should only mark the stream as "ready" if it can immediately send data. Depending on the application, that could be different things. A 'sensor" application might want to just get the state of the sensor. A video conference application might mark the stream ready when a video frame has been prepared, and then send the bytes of the frame in response to the "prepare to send" callback. It might fragment the data and send them in response to several successive callbacks. |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
There is a commonly used caveat not to sit in callbacks, while I do not get the full picture for the picoquic_prepare_to_send callback (likely also its datagram counterpart). The buffer and length variables appear only in the callback context. Is the preferred pattern to perform a "wait for data" here or to decouple this via storing the pointers/value of buffer and length into a queue (which raises other questions in terms of concurrency).?
Beta Was this translation helpful? Give feedback.
All reactions