Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Integrate ecaludp #51

Closed
wants to merge 9 commits into from
Closed

Integrate ecaludp #51

wants to merge 9 commits into from

Conversation

rex-schilasky
Copy link
Contributor

Description

Replace eCAL asio native udp socket handling with ecaludp.

@rex-schilasky rex-schilasky marked this pull request as draft March 28, 2024 09:16
Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

clang-tidy made some suggestions

m_created = true;
}

CSampleSender::~CSampleSender()
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: an exception may be thrown in function '~CSampleSender' which should not throw exceptions [bugprone-exception-escape]

    CSampleSender::~CSampleSender()
                   ^

// s2 Bytes serialized sample
// ------------------------------------------------
unsigned short s1 = static_cast<unsigned short>(sample_name_.size());
size_t s2 = serialized_sample_.size();
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: variable 's2' of type 'size_t' (aka 'unsigned long') can be declared 'const' [misc-const-correctness]

Suggested change
size_t s2 = serialized_sample_.size();
size_t const s2 = serialized_sample_.size();

// ------------------------------------------------
unsigned short s1 = static_cast<unsigned short>(sample_name_.size());
size_t s2 = serialized_sample_.size();
asio::const_buffer sample_name_size_asio_buffer(&s1, 2);
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: variable 'sample_name_size_asio_buffer' of type 'asio::const_buffer' can be declared 'const' [misc-const-correctness]

Suggested change
asio::const_buffer sample_name_size_asio_buffer(&s1, 2);
asio::const_buffer const sample_name_size_asio_buffer(&s1, 2);

unsigned short s1 = static_cast<unsigned short>(sample_name_.size());
size_t s2 = serialized_sample_.size();
asio::const_buffer sample_name_size_asio_buffer(&s1, 2);
asio::const_buffer sample_name_asio_buffer(sample_name_.data(), s1);
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: variable 'sample_name_asio_buffer' of type 'asio::const_buffer' can be declared 'const' [misc-const-correctness]

Suggested change
asio::const_buffer sample_name_asio_buffer(sample_name_.data(), s1);
asio::const_buffer const sample_name_asio_buffer(sample_name_.data(), s1);

size_t s2 = serialized_sample_.size();
asio::const_buffer sample_name_size_asio_buffer(&s1, 2);
asio::const_buffer sample_name_asio_buffer(sample_name_.data(), s1);
asio::const_buffer serialized_sample_asio_buffer(serialized_sample_.data(), s2);
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: variable 'serialized_sample_asio_buffer' of type 'asio::const_buffer' can be declared 'const' [misc-const-correctness]

Suggested change
asio::const_buffer serialized_sample_asio_buffer(serialized_sample_.data(), s2);
asio::const_buffer const serialized_sample_asio_buffer(serialized_sample_.data(), s2);

//std::cout << "UDP Sample Buffer Sent (" << std::to_string(sent_sum) << " Bytes)" << std::endl;;
// notify waiting main thread
{
std::lock_guard<std::mutex> lock(send_mtx);
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: variable 'lock' of type 'std::lock_guardstd::mutex' can be declared 'const' [misc-const-correctness]

Suggested change
std::lock_guard<std::mutex> lock(send_mtx);
std::lock_guard<std::mutex> const lock(send_mtx);

@rex-schilasky rex-schilasky deleted the integrate-ecaludp branch April 3, 2024 18:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant