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

Client sequence numbering #315

Open
martinhaefner opened this issue Jun 12, 2018 · 2 comments
Open

Client sequence numbering #315

martinhaefner opened this issue Jun 12, 2018 · 2 comments

Comments

@martinhaefner
Copy link

Hi all,

I am using your very smart library to communicate with a server written with the open62541 sdk. I get frequent disconnects from the server since the server only accepts messages from the client with strictly increasing sequence number. I had a look into the source of the freeopcua binray client and found a possible race condition. Fixing it, I have no further disconnects from the server.

There is a send_mutex in the binary_client.cpp and I put it around any sections where a sequence header is generated and the header is sent on the Stream later on, e.g.

std::unique_lock<std::mutex> send_lock(send_mutex);

const SequenceHeader sequence = CreateSequenceHeader();
hdr.AddSize(RawSize(sequence));
hdr.AddSize(RawSize(request));

Stream << hdr << algorithmHeader << sequence << request << flush;

Maybe you find some time to fix this issue?!

Regards,
Martin

@ralf1070
Copy link
Contributor

Is it possible for you to create a pull request containing this modification?

@martinhaefner
Copy link
Author

Done in #316

Regards,
Martin

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

No branches or pull requests

2 participants