diff options
author | Matthias P. Braendli <matthias.braendli@mpb.li> | 2024-08-20 15:12:36 +0200 |
---|---|---|
committer | Matthias P. Braendli <matthias.braendli@mpb.li> | 2024-08-20 15:12:36 +0200 |
commit | 4cf48cce116192b5bcdf0656c026f6403026f88e (patch) | |
tree | c2ba4c75a058567d724b3977e15e483903c1f655 /contrib/Socket.h | |
parent | dcbf473dd5a0abedd26a0a668d04820d398c1e37 (diff) | |
download | ODR-AudioEnc-4cf48cce116192b5bcdf0656c026f6403026f88e.tar.gz ODR-AudioEnc-4cf48cce116192b5bcdf0656c026f6403026f88e.tar.bz2 ODR-AudioEnc-4cf48cce116192b5bcdf0656c026f6403026f88e.zip |
Update common code
Diffstat (limited to 'contrib/Socket.h')
-rw-r--r-- | contrib/Socket.h | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/contrib/Socket.h b/contrib/Socket.h index 44f93d0..1320a64 100644 --- a/contrib/Socket.h +++ b/contrib/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 */ |