Skip to content

Commit a8a89ca

Browse files
committed
Keep mcast addr in addon
1 parent 8833ed0 commit a8a89ca

3 files changed

Lines changed: 6 additions & 4 deletions

File tree

plugins/dogma/dogma/UdpTransport.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,7 @@ namespace dogma {
9797
dabc::BufferSize_t fBufferSize{0}; ///< available buffer size
9898
std::string fHostName; ///< host name used to create UDP socket
9999
int fRecvBufLen{100000}; ///< recv buf len
100+
std::string fMcastAddr; ///< mcast address
100101
unsigned fMTU{0}; ///< maximal size of packet expected from DOG
101102
void* fMtuBuffer{nullptr}; ///< buffer used to skip packets when no normal buffer is available
102103
int fSkipCnt{0}; ///< counter used to control buffers skipping
@@ -121,7 +122,7 @@ namespace dogma {
121122
bool CloseBuffer();
122123

123124
public:
124-
UdpAddon(int fd, const std::string &host, int nport, int rcvbuflen, int mtu, bool debug, bool print, int maxloop, double reduce);
125+
UdpAddon(int fd, const std::string &host, int nport, int rcvbuflen, const std::string &mcast, int mtu, bool debug, bool print, int maxloop, double reduce);
125126
~UdpAddon() override;
126127

127128
bool HasBuffer() const { return !fTgtPtr.null(); }

plugins/dogma/src/Factory.cxx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,6 @@ dabc::Module* dogma::Factory::CreateTransport(const dabc::Reference& port, const
111111

112112
DOUT0("Start DOGMA UDP transport on %s", url.GetHostNameWithPort().c_str());
113113

114-
auto addon = new dogma::UdpAddon(fd, host, nport, rcvbuflen, mtu, debug, print, maxloop, reduce);
114+
auto addon = new dogma::UdpAddon(fd, host, nport, rcvbuflen, mcast, mtu, debug, print, maxloop, reduce);
115115
return new dogma::UdpTransport(cmd, portref, addon, flush, heartbeat);
116116
}

plugins/dogma/src/UdpTransport.cxx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,12 +34,13 @@
3434
// according to specification maximal UDP packet is 65,507 or 0xFFE3
3535
#define DEFAULT_MTU 0xFFF0
3636

37-
dogma::UdpAddon::UdpAddon(int fd, const std::string &host, int nport, int rcvbuflen, int mtu, bool debug, bool print, int maxloop, double reduce) :
37+
dogma::UdpAddon::UdpAddon(int fd, const std::string &host, int nport, int rcvbuflen, const std::string &mcast, int mtu, bool debug, bool print, int maxloop, double reduce) :
3838
dabc::SocketAddon(fd),
3939
TransportInfo(nport),
4040
fTgtPtr(),
4141
fHostName(host),
4242
fRecvBufLen(rcvbuflen),
43+
fMcastAddr(mcast),
4344
fMTU(mtu > 0 ? mtu : DEFAULT_MTU),
4445
fMtuBuffer(nullptr),
4546
fSkipCnt(0),
@@ -355,7 +356,7 @@ int dogma::UdpTransport::ExecuteCommand(dabc::Command cmd)
355356
auto addon = static_cast<UdpAddon *>(fAddon());
356357
if (addon) {
357358
addon->CloseSocket();
358-
int fd = dogma::UdpAddon::OpenUdp(addon->fHostName, addon->fNPort, addon->fRecvBufLen);
359+
int fd = dogma::UdpAddon::OpenUdp(addon->fHostName, addon->fNPort, addon->fRecvBufLen, addon->fMcastAddr);
359360
if (fd <= 0) {
360361
EOUT("Cannot recreate UDP socket for port %d", addon->fNPort);
361362
dabc::mgr.StopApplication();

0 commit comments

Comments
 (0)