Thread (20 messages) 20 messages, 7 authors, 2015-09-17

socket can receive order

From: Daniel Squires <hidden>
Date: 2015-09-08 09:49:37

Hi all,

new to this list.

Just a quick question at present, when using recv on a socket that is 
bound to a can interface, should the packets be received in the order 
they came off the wire? or is this not guaranteed?

for example, is this valid or an error in some part of the system?

candump can3 -tz
<snip>
  (003.088648)  can3  043   [8]  F7 2D 00 00 00 00 00 00
  (003.089149)  can3  045   [8]  F9 2D 00 00 00 00 00 00
  (003.088897)  can3  044   [8]  F8 2D 00 00 00 00 00 00

The packets were sent to the wire in order, the CAN ID is incremented 
with each send to ensure mailbox/arbitration details dont mess up the 
order on to the wire, the packets were seen coming off the wire over USB 
in wireshark in the correct order, but my test utility which aborts when 
something unexpected happens and candump both see this out of sequence 
result. Note that  the timestamps confirm that something saw them in the 
correct order, but recv returns them out of order.

Another identical receiver with another instance of candump sees the 
packets in the expected order, but sees other packets at other times out 
of order, i.e. it appears random.

Thanks

-- 
Dan Squires

Engineered Arts Ltd.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help