diff options
Diffstat (limited to 'CAN-binder/low-can-binding/utils/socketcan.cpp')
-rw-r--r-- | CAN-binder/low-can-binding/utils/socketcan.cpp | 11 |
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 4d226547..f52aaa6d 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 { |