diff --git a/ecal/core/src/io/udp/fragmentation/snd_fragments.cpp b/ecal/core/src/io/udp/fragmentation/snd_fragments.cpp index a4a8320805..4cfafa26a4 100644 --- a/ecal/core/src/io/udp/fragmentation/snd_fragments.cpp +++ b/ecal/core/src/io/udp/fragmentation/snd_fragments.cpp @@ -79,7 +79,7 @@ namespace IO return (0); } - size_t SendFragmentedMessage(char* buf_, size_t buf_len_, long bandwidth_, TransmitCallbackT transmit_cb_) + size_t SendFragmentedMessage(char* buf_, size_t buf_len_, long bandwidth_, const TransmitCallbackT& transmit_cb_) { if (buf_ == nullptr) return(0); diff --git a/ecal/core/src/io/udp/fragmentation/snd_fragments.h b/ecal/core/src/io/udp/fragmentation/snd_fragments.h index 83adb1b78d..3638e7070d 100644 --- a/ecal/core/src/io/udp/fragmentation/snd_fragments.h +++ b/ecal/core/src/io/udp/fragmentation/snd_fragments.h @@ -39,6 +39,6 @@ namespace IO size_t CreateSampleBuffer(const std::string& sample_name_, const eCAL::pb::Sample& ecal_sample_, std::vector& payload_); using TransmitCallbackT = std::function; - size_t SendFragmentedMessage(char* buf_, size_t buf_len_, long bandwidth_, TransmitCallbackT transmit_cb_); + size_t SendFragmentedMessage(char* buf_, size_t buf_len_, long bandwidth_, const TransmitCallbackT& transmit_cb_); } } diff --git a/ecal/core/src/io/udp/sendreceive/udp_receiver_asio.cpp b/ecal/core/src/io/udp/sendreceive/udp_receiver_asio.cpp index e14268a53c..51b57e2d65 100644 --- a/ecal/core/src/io/udp/sendreceive/udp_receiver_asio.cpp +++ b/ecal/core/src/io/udp/sendreceive/udp_receiver_asio.cpp @@ -129,14 +129,6 @@ namespace IO return(false); } } - -#ifdef ECAL_JOIN_MULTICAST_TWICE - // this is a very bad workaround because of an identified bug on a specific embedded device - // we join the multicast group multiple times otherwise the socket will not receive any data - std::cerr << "eCAL was compiled with ECAL_JOIN_MULTICAST_TWICE" << std::endl; - m_socket.set_option(asio::ip::multicast::leave_group(asio::ip::make_address(ipaddr_))); - m_socket.set_option(asio::ip::multicast::join_group(asio::ip::make_address(ipaddr_))); -#endif // ECAL_JOIN_MULTICAST_TWICE } return(true); } diff --git a/ecal/core/src/io/udp/sendreceive/udp_receiver_asio.h b/ecal/core/src/io/udp/sendreceive/udp_receiver_asio.h index 28dd8362ad..2c1d3fe0f7 100644 --- a/ecal/core/src/io/udp/sendreceive/udp_receiver_asio.h +++ b/ecal/core/src/io/udp/sendreceive/udp_receiver_asio.h @@ -41,7 +41,7 @@ namespace IO // this virtual function is called during construction/destruction, // so, mark it as final to ensure that no derived classes override it. - bool AddMultiCastGroup(const char* ipaddr_) final override; + bool AddMultiCastGroup(const char* ipaddr_) final; bool RemMultiCastGroup(const char* ipaddr_) override; size_t Receive(char* buf_, size_t len_, int timeout_, ::sockaddr_in* address_ = nullptr) override; diff --git a/ecal/core/src/io/udp/sendreceive/udp_receiver_impl.h b/ecal/core/src/io/udp/sendreceive/udp_receiver_impl.h deleted file mode 100644 index b05434d292..0000000000 --- a/ecal/core/src/io/udp/sendreceive/udp_receiver_impl.h +++ /dev/null @@ -1,47 +0,0 @@ -/* ========================= eCAL LICENSE ================================= - * - * Copyright (C) 2016 - 2019 Continental Corporation - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * ========================= eCAL LICENSE ================================= -*/ - -#pragma once - -#include "udp_receiver.h" - -namespace eCAL -{ - //////////////////////////////////////////////////////// - // udp receiver class implementation - //////////////////////////////////////////////////////// - class CUDPReceiverImpl - { - public: - CUDPReceiverImpl(const SReceiverAttr& /*attr_*/) {}; - // We don't technically need a virtual destructor, if we are working with shared_ptrs... - virtual ~CUDPReceiverImpl() = default; - - // Delete copy / move operations to prevent slicing - CUDPReceiverImpl(CUDPReceiverImpl&&) = delete; - CUDPReceiverImpl& operator=(CUDPReceiverImpl&&) = delete; - CUDPReceiverImpl(const CUDPReceiverImpl&) = delete; - CUDPReceiverImpl& operator=(const CUDPReceiverImpl&) = delete; - - virtual bool AddMultiCastGroup(const char* ipaddr_) = 0; - virtual bool RemMultiCastGroup(const char* ipaddr_) = 0; - - virtual size_t Receive(char* buf_, size_t len_, int timeout_, ::sockaddr_in* address_ = nullptr) = 0; - }; -} diff --git a/ecal/core/src/io/udp/sendreceive/udp_sender.cpp b/ecal/core/src/io/udp/sendreceive/udp_sender.cpp index 33c8fe9928..5bca08c93d 100644 --- a/ecal/core/src/io/udp/sendreceive/udp_sender.cpp +++ b/ecal/core/src/io/udp/sendreceive/udp_sender.cpp @@ -24,7 +24,6 @@ #include "udp_sender.h" #include -#include #ifdef _MSC_VER #pragma warning(push)