Skip to content
Snippets Groups Projects
Verified Commit 60492f4d authored by Moritz Lammerich's avatar Moritz Lammerich
Browse files

add Doc comment explaining copy behaviour

parent 4500bd97
Branches
No related tags found
No related merge requests found
......@@ -33,6 +33,15 @@ class CAN {
close(sock);
}
/**
* Duplicate the CAN socket.
*
* IMPORTANT NOTE: Frames are not replicated between CAN objects!
* All copies of a CAN object share the same kernel buffers, so only one copy
* of CAN will receive any given frame. Think of it like sharing the socket
* but C++/the compiler and the kernel handle thread safety and
* resource management.
*/
CAN(const CAN& s) {
sock = dup(s.sock);
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment