Closed superdan-t closed 2 years ago
The original description is from 13 days ago. It summarizes some of the problems, but the solution is still in design. I will post my ideas within the next hour.
My ideas:
rover_can::Socket
async_send_to(<variables needed to send...>, const std::function<void(rover_can::ErrorCode)>& send_callback = nullptr);
std::mutex
) and also have a condition variable std::condition_variable
. When enqueuing, the lock must be locked, and then the condition variable notified before returning.async_receive_from(<variables needed to request...>, const std::function<void(ReceivedDataType, rover_can::ErrorCode)>);
@jmcmah10 Is this issue relevant anymore? I think everything here got worked into other issues.
@superdan-t it's not, it can be closed
If too many CAN frames are sent, the program crashes with a segmentation fault. Something within CAN send is probably buffered, and thus sends are non-blocking (evident by the fact it's even possible to send too fast).
It is likely possible to do blocking sends on the CAN socket so that this doesn't happen. Then, sends can be moved to a new thread.
This design will use two threads: