Skip to content

Commit

Permalink
Revert "ensure correct udp socket concurrent handling by mutex (#1289)…
Browse files Browse the repository at this point in the history
…" (#1352)

This reverts commit 771280e.
  • Loading branch information
FlorianReimold committed Feb 7, 2024
1 parent 54934df commit 99079ba
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 12 deletions.
9 changes: 0 additions & 9 deletions ecal/core/src/io/udp_receiver.cpp
Expand Up @@ -78,34 +78,25 @@ 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: 1 addition & 3 deletions ecal/core/src/io/udp_receiver.h
Expand Up @@ -24,7 +24,6 @@
#pragma once

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

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

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

0 comments on commit 99079ba

Please sign in to comment.