Transmission API (cont.)
Request API works for asynchronous sources
wait for (some_events) {
get_data(); /* e.g., from a file, image capture, etc. */
send(); /* call cm_request() and send on callback */
}
But what about synchronous sources (e.g., audio with constant sampling rate)?
do_every_t_ms { /* timer loop */
get_data();
send(); /* oops, waiting for send callback wrecks timing */
}
Solution: rate-change callback cmapp_update(rate, srtt)