Giter Club home page Giter Club logo

Comments (4)

nauful avatar nauful commented on September 2, 2024 1

Done both, please try now.

from libua.

nauful avatar nauful commented on September 2, 2024

Hello,

Glad you like my library.

IP binding

I don't expose this by default but you can promote IPEndPoint to a parameter for this function:

IPEndPoint localEndPoint = new IPEndPoint(IPAddress.Any, Port);

Then you can pass in an ip to bind to here:
server.Start();

For user-level permissions,

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:


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.

Storage

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.

from libua.

franklupo avatar franklupo commented on September 2, 2024

Hi,

IP binding

https://github.com/nauful/LibUA/blob/c8e642d10b1f39543bc1487c8e0fa496ef743b17/NET%20Core/LibUA/Server.cs#L35C11-L35C17it would be nice to pass endpoint to constructor

For user-level permissions,

https://github.com/nauful/LibUA/blob/c8e642d10b1f39543bc1487c8e0fa496ef743b17/NET%20Core/LibUA/Application.cs#L633
the SessionHasPermissionToRead is not virtual, ovveride is not possible

best regards

from libua.

nauful avatar nauful commented on September 2, 2024

Closed, finished work.

from libua.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.