summaryrefslogtreecommitdiffstats
path: root/lib/Socket.h
diff options
context:
space:
mode:
authorMatthias P. Braendli <matthias.braendli@mpb.li>2024-08-20 15:01:25 +0200
committerMatthias P. Braendli <matthias.braendli@mpb.li>2024-08-20 15:01:25 +0200
commit9b18142f07d9d87bd9eced148a245b1d37bda29a (patch)
treef58fac90e103b6a9406a1347cd5e13b865f6de0a /lib/Socket.h
parent3986a7b40c0043ec33c2c2b7cf5c615c65599997 (diff)
downloaddabmux-9b18142f07d9d87bd9eced148a245b1d37bda29a.tar.gz
dabmux-9b18142f07d9d87bd9eced148a245b1d37bda29a.tar.bz2
dabmux-9b18142f07d9d87bd9eced148a245b1d37bda29a.zip
Update common: improve multicast input and incomplete timestamps
Diffstat (limited to 'lib/Socket.h')
-rw-r--r--lib/Socket.h10
1 files changed, 7 insertions, 3 deletions
diff --git a/lib/Socket.h b/lib/Socket.h
index 44f93d0..1320a64 100644
--- a/lib/Socket.h
+++ b/lib/Socket.h
@@ -2,7 +2,7 @@
Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009 Her Majesty the
Queen in Right of Canada (Communications Research Center Canada)
- Copyright (C) 2022
+ Copyright (C) 2024
Matthias P. Braendli, matthias.braendli@mpb.li
http://www.opendigitalradio.org
@@ -31,7 +31,7 @@
#include "ThreadsafeQueue.h"
#include <cstdlib>
#include <atomic>
-#include <iostream>
+#include <string>
#include <list>
#include <memory>
#include <thread>
@@ -118,7 +118,6 @@ class UDPSocket
void send(const std::vector<uint8_t>& data, InetAddress destination);
void send(const std::string& data, InetAddress destination);
UDPPacket receive(size_t max_size);
- void joinGroup(const char* groupname, const char* if_addr = nullptr);
void setMulticastSource(const char* source_addr);
void setMulticastTTL(int ttl);
@@ -130,9 +129,14 @@ class UDPSocket
SOCKET getNativeSocket() const;
int getPort() const;
+ private:
+ void join_group(const char* groupname, const char* if_addr = nullptr);
+ void post_init();
+
protected:
SOCKET m_sock = INVALID_SOCKET;
int m_port = 0;
+ std::string m_multicast_source = "";
};
/* UDP packet receiver supporting receiving from several ports at once */