Fix diagnostic message subscription.
[apps/agl-service-can-low-level.git] / CAN-binder / low-can-binding / utils / socketcan.cpp
index d66822d..1f7aaa6 100644 (file)
@@ -31,16 +31,15 @@ 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_}
+       {}
+
+       socketcan_t& socketcan_t::operator=(const socketcan_t& s)
        {
-               s.socket_ = INVALID_SOCKET;
+               socket_ = std::move(s.socket_);
+               return *this;
        }
 
        socketcan_t::~socketcan_t()