Skip to content

Commit

Permalink
minor alignments with ecal-core-udp
Browse files Browse the repository at this point in the history
  • Loading branch information
rex-schilasky committed Dec 12, 2023
1 parent 69da2b1 commit 4a90d87
Show file tree
Hide file tree
Showing 6 changed files with 3 additions and 59 deletions.
2 changes: 1 addition & 1 deletion ecal/core/src/io/udp/fragmentation/snd_fragments.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down
2 changes: 1 addition & 1 deletion ecal/core/src/io/udp/fragmentation/snd_fragments.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,6 @@ namespace IO
size_t CreateSampleBuffer(const std::string& sample_name_, const eCAL::pb::Sample& ecal_sample_, std::vector<char>& payload_);

using TransmitCallbackT = std::function<size_t(const void*, const size_t)>;
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_);
}
}
8 changes: 0 additions & 8 deletions ecal/core/src/io/udp/sendreceive/udp_receiver_asio.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down
2 changes: 1 addition & 1 deletion ecal/core/src/io/udp/sendreceive/udp_receiver_asio.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
47 changes: 0 additions & 47 deletions ecal/core/src/io/udp/sendreceive/udp_receiver_impl.h

This file was deleted.

1 change: 0 additions & 1 deletion ecal/core/src/io/udp/sendreceive/udp_sender.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
#include "udp_sender.h"

#include <iostream>
#include <functional>

#ifdef _MSC_VER
#pragma warning(push)
Expand Down

0 comments on commit 4a90d87

Please sign in to comment.