Closed guiccbr closed 8 years ago
Just subtracting would not work properly because of the way we're filling up the buffer in queue_send_data(). For it to work right we would need to implement some sort of circular fifo, handling possible buffer overflows, etc.
Another option would be to lock inside handle_send() until all data has been sent. But if for any reason handle_send() is not successful and stays locked for too long, the plugin might crash gazebo because the update loop could possibly never end.
Since it is an UDP socket and the buffer is small, I think its a better strategy just to keep it simple and try to send the message again on the next call. But I'm not sure if that's the best approach.
Indeed. LGTM then.
In order to avoid coverity check problems.
Signed-off-by: Guilherme Campos Camargo guilherme.campos.camargo@intel.com