title: How socketcan get send failure status?
body: <p>As we all know, in the CAN bus communication protocol, sender know whether the data was successfully sent. I send socketcan data as follows.</p>
  
  <pre><code>ret = write (socket, frame, sizeof (struct can_frame));
  </code></pre>
  
  <p>However, even if the CAN communication cable is disconnected, the return value of ret is still 16(=sizeof (struct can_frame)).I queried the information and found that the problem was due to the tx_queue of the network stack used by socketcan. When write is called multiple times, the buffer is full and the return value of ret is -1.
   But this is not the behavior I expect, I hope that every frame of data sent will immediately get the status of success or failure.
  By</p>
  
  <pre><code>echo 0&gt; / sys / class / net / can0 / tx_queue_len
  </code></pre>
  
  <p>I want to cancel the tx_queue, but it does not work.
   What I want to ask is, is there a way to cancel the tx_queue of socketcan, or to get the status of the each sending frame about controller through the API (such as libsocketcan). 
   Thanks.</p>