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

move recv() loop from uasc into opcua package #211

Merged
merged 5 commits into from
Jun 17, 2019
Merged

Conversation

dwhutchison
Copy link
Collaborator

In preparation for a server implementation, move the main read
loop out of the uasc package into the application layer. The primary change is recv() (renamed to receive), now returns each time it receives a full message. This allows the caller (client or server) to receive unsolicited uasc messages from the channel.

The context can be better seen in https://github.com/gopcua/opcua/tree/feature/server although that code isn't fleshed out enough to merge. The remainder of the server implementation shouldn't have further impact on the uasc package as this change so I'm hoping to get this into the main branch to avoid needing to constantly fix merge conflicts with master.

client.go Show resolved Hide resolved
uasc/secure_channel.go Outdated Show resolved Hide resolved
Copy link
Member

@magiconair magiconair left a comment

Choose a reason for hiding this comment

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

First round.

uasc/secure_channel.go Outdated Show resolved Hide resolved
uasc/secure_channel.go Outdated Show resolved Hide resolved
uasc/secure_channel.go Outdated Show resolved Hide resolved
uasc/secure_channel.go Outdated Show resolved Hide resolved
uasc/secure_channel.go Outdated Show resolved Hide resolved
@magiconair
Copy link
Member

@dwhutchison does this conflict with #207 ? If not, then we can merge this.

@magiconair
Copy link
Member

One small optimization could be to create a ctx := context.Background() at the beginning of all examples and then just use that instead of context.Background().

@dwhutchison
Copy link
Collaborator Author

There's a couple minor conflicts with #207 due to the timeout changes. Let's finish #207 first then I'll circle back and clean up the conflicts here

In preparation for a server implmentation, move the main read
loop out of the uasc package and allow the caller (client / server)
to receive unsolicited uasc messages.
@dwhutchison
Copy link
Collaborator Author

Force-push just to rebase to master

@dwhutchison
Copy link
Collaborator Author

This should be OK to merge; tests are passing and the examples are functional.
Let me know if there are any objections.

@magiconair
Copy link
Member

Then lets merge it and move on.

@dwhutchison dwhutchison merged commit 4c56f8a into master Jun 17, 2019
@dwhutchison dwhutchison deleted the uasc-server-prep branch June 17, 2019 20:00
dwhutchison added a commit that referenced this pull request Jun 28, 2019
magiconair added a commit that referenced this pull request Jun 28, 2019
@magiconair magiconair added this to the v0.1.1 milestone Jul 10, 2019
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.

None yet

3 participants