Thank you for this amazing library.
I'm gauging if uvw is suitable for low-latency & low-jitter media streaming over udp (using rtp). So far it looks quite promising.
One of the things I ran into is that there doesn't seem to be a reliable way of reclaiming memory which was previously allocated inside a custom allocator callback (link).
Inside the uvw::udp_handle::recv_callback, ownership of the allocated memory is taken by wrapping it with a std::unique_ptr (link). Although this is good practice, the udp_data_event is not triggered in all cases after that. When there is no more data to read or when there is a transmission error the udp_data_event is never called which makes it impossible to move the memory out of the std::unique_ptr. In practice the nread == 0 && addr == nullptr case happens a lot.
Unless I'm missing something (please let me know if this is the case), it would be really appreciated if you could add functionality that helps reclaiming memory in a consistent way. I'm thinking maybe adding an event type makes sense.
I'd also be willing to spend time on this and come up with a PR. Let me know if you'd prefer this.
Thank you for this amazing library.
I'm gauging if
uvwis suitable for low-latency & low-jitter media streaming over udp (using rtp). So far it looks quite promising.One of the things I ran into is that there doesn't seem to be a reliable way of reclaiming memory which was previously allocated inside a custom allocator callback (link).
Inside the
uvw::udp_handle::recv_callback, ownership of the allocated memory is taken by wrapping it with astd::unique_ptr(link). Although this is good practice, theudp_data_eventis not triggered in all cases after that. When there is no more data to read or when there is a transmission error theudp_data_eventis never called which makes it impossible to move the memory out of thestd::unique_ptr. In practice thenread == 0 && addr == nullptrcase happens a lot.Unless I'm missing something (please let me know if this is the case), it would be really appreciated if you could add functionality that helps reclaiming memory in a consistent way. I'm thinking maybe adding an event type makes sense.
I'd also be willing to spend time on this and come up with a PR. Let me know if you'd prefer this.