Skip to content

Commit

Permalink
Merge master to successfully build CI (#1311)
Browse files Browse the repository at this point in the history
* ensure correct udp socket concurrent handling by mutex (#1289)
* Doc: Downgraded sphinx related packages in requirements.txt (#1302) (#1309)
* The most recent release of various sphinx related packages need Sphinx 5 or up, but our old sphinx-book-theme 0.3.3 requires Sphinx 4
For a proper solution see #1303
---------
Co-authored-by: KerstinKeller <[email protected]>
Co-authored-by: Florian Reimold <[email protected]>
  • Loading branch information
rex-schilasky authored Jan 18, 2024
1 parent 7e87ddb commit 2d3ac97
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 2 deletions.
6 changes: 5 additions & 1 deletion doc/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,8 @@ exhale
Jinja2
sphinxcontrib-youtube<=1.2
sphinxcontrib-apidoc

sphinxcontrib-applehelp<=1.0.7 # 2024-01-15: Newer packages needs Sphinx 5 or up, but our old sphinx-book-theme 0.3.3 requires Sphinx 4
sphinxcontrib-devhelp<=1.0.5 # 2024-01-15: Newer packages need Sphinx 5 or up, but our old sphinx-book-theme 0.3.3 requires Sphinx 4
sphinxcontrib-htmlhelp<=2.0.4 # 2024-01-15: Newer packages (probably) need Sphinx 5 or up, but our old sphinx-book-theme 0.3.3 requires Sphinx 4
sphinxcontrib-qthelp<=1.0.6 # 2024-01-15: Newer packages (probably) need Sphinx 5 or up, but our old sphinx-book-theme 0.3.3 requires Sphinx 4
sphinxcontrib-serializinghtml<=1.1.9 # 2024-01-15: Newer packages (probably) need Sphinx 5 or up, but our old sphinx-book-theme 0.3.3 requires Sphinx 4
9 changes: 9 additions & 0 deletions ecal/core/src/io/udp_receiver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -73,25 +73,34 @@ namespace eCAL
bool CUDPReceiver::Destroy()
{
if (!m_socket_impl) return(false);

const std::lock_guard<std::mutex> lock(m_socket_mtx);
m_socket_impl.reset();

return(true);
}

bool CUDPReceiver::AddMultiCastGroup(const char* ipaddr_)
{
if (!m_socket_impl) return(false);

const std::lock_guard<std::mutex> lock(m_socket_mtx);
return(m_socket_impl->AddMultiCastGroup(ipaddr_));
}

bool CUDPReceiver::RemMultiCastGroup(const char* ipaddr_)
{
if (!m_socket_impl) return(false);

const std::lock_guard<std::mutex> lock(m_socket_mtx);
return(m_socket_impl->RemMultiCastGroup(ipaddr_));
}

size_t CUDPReceiver::Receive(char* buf_, size_t len_, int timeout_, ::sockaddr_in* address_ /* = nullptr */)
{
if (!m_socket_impl) return(0);

const std::lock_guard<std::mutex> lock(m_socket_mtx);
return(m_socket_impl->Receive(buf_, len_, timeout_, address_));
}
}
4 changes: 3 additions & 1 deletion ecal/core/src/io/udp_receiver.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
#pragma once

#include <memory>
#include <mutex>
#include "ecal_receiver.h"

namespace eCAL
Expand All @@ -44,7 +45,8 @@ namespace eCAL
size_t Receive(char* buf_, size_t len_, int timeout_, ::sockaddr_in* address_ = nullptr) override;

protected:
bool m_use_npcap;
bool m_use_npcap;
std::mutex m_socket_mtx;
std::shared_ptr<CUDPReceiverBase> m_socket_impl;
};
}

0 comments on commit 2d3ac97

Please sign in to comment.