Closed franklupo closed 1 year ago
Hello,
Glad you like my library.
I don't expose this by default but you can promote IPEndPoint
to a parameter for this function:
https://github.com/nauful/LibUA/blob/c8e642d10b1f39543bc1487c8e0fa496ef743b17/NET%20Core/LibUA/Server.cs#L60
Then you can pass in an ip to bind to here: https://github.com/nauful/LibUA/blob/c8e642d10b1f39543bc1487c8e0fa496ef743b17/NET%20Core/TestServer/Program.cs#L590
Create a session object (any type of your design) and return a new instance here: https://github.com/nauful/LibUA/blob/c8e642d10b1f39543bc1487c8e0fa496ef743b17/NET%20Core/TestServer/Program.cs#L105C41-L105C61
E.g. session.state == Unassigned now
When the client sends a username + password, assign it to your session object here: https://github.com/nauful/LibUA/blob/c8e642d10b1f39543bc1487c8e0fa496ef743b17/NET%20Core/TestServer/Program.cs#L138
E.g. session.state == Logged in, session.username == username now
Implement this in your Application
: https://github.com/nauful/LibUA/blob/c8e642d10b1f39543bc1487c8e0fa496ef743b17/NET%20Core/LibUA/Application.cs#L633
Now you can check if session[Logged in, username] has permission to access any particular NodeId
.
For memory I use a Dictionary<NodeId, MyDataTypes>
.
For storage you can use a normal database (sqlite, MySql, etc) or any time-series database (my original use case when I started this library). You can write to Dictionary and db when receiving a ua write, read from dictionary or read from db and cache in dictionary.
Hi,
https://github.com/nauful/LibUA/blob/c8e642d10b1f39543bc1487c8e0fa496ef743b17/NET%20Core/LibUA/Server.cs#L35C11-L35C17it would be nice to pass endpoint to constructor
https://github.com/nauful/LibUA/blob/c8e642d10b1f39543bc1487c8e0fa496ef743b17/NET%20Core/LibUA/Application.cs#L633 the SessionHasPermissionToRead is not virtual, ovveride is not possible
best regards
Done both, please try now.
Closed, finished work.
Hi, First I wanted to thank you for your great work for this great library.
best regards