summaryrefslogtreecommitdiffstats
path: root/CAN-binder/low-can-binding/utils/socketcan.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'CAN-binder/low-can-binding/utils/socketcan.cpp')
-rw-r--r--CAN-binder/low-can-binding/utils/socketcan.cpp11
1 files changed, 6 insertions, 5 deletions
diff --git a/CAN-binder/low-can-binding/utils/socketcan.cpp b/CAN-binder/low-can-binding/utils/socketcan.cpp
index 4d22654..f52aaa6 100644
--- a/CAN-binder/low-can-binding/utils/socketcan.cpp
+++ b/CAN-binder/low-can-binding/utils/socketcan.cpp
@@ -31,6 +31,11 @@ namespace utils
: socket_{INVALID_SOCKET}
{}
+ /// @brief Construct a socket by copying an existing one.
+ socketcan_t::socketcan_t(const socketcan_t& s)
+ : socket_{s.socket_}
+ {}
+
/// @brief Construct a socket by moving an existing one.
socketcan_t::socketcan_t(socketcan_t&& s)
: socket_{s.socket_}
@@ -38,12 +43,8 @@ namespace utils
s.socket_ = INVALID_SOCKET;
}
- /// @brief Destruct the socket.
socketcan_t::~socketcan_t()
- {
- if(socket_ != INVALID_SOCKET)
- ::close(socket_);
- }
+ {}
const struct sockaddr_can& socketcan_t::get_tx_address() const
{