Async OPC-UA Server
Part of async-opcua, a general purpose OPC-UA library in rust.
This library defines a general purpose OPC-UA server based on tokio. You will need a tokio runtime to run the server, as it depends on tokio for network and I/O.
The OPC-UA Server module contains functionality for defining an OPC-UA server containing custom structures that build on the core namespace. Each connected client is spawned on its own tokio task, and each received message also spawns a task, this is similar in design to how webserver frameworks such as Axum
work.
To create a server, first build and configure one using the ServerBuilder
, then run it using Server::run
. The server, when constructed, returns a Server
and a ServerHandle
. The server handle contains references to core server types and can be used to manage the server externally, modifying its contents, stopping it, etc.
Features
discovery-server-registration
, pulls in theasync-opcua-client
library to act as a client, attempting to register the server on a local discovery server.generated-address-space
, enabled by default. This feature pulls in theasync-opcua-core-namespace
crate, which contains the entire core OPC-UA namespace. This is used to populate the core OPC-UA namespace. Without this, it is difficult to make a compliant OPC-UA server.json
, adds support for deserializing and serializing OPC-UA types as JSON.
Example
async
For more detailed documentation on the server see server.md and advanced_server.md.
The server SDK is very flexible. There are mechanisms to make simple usage easier, but writing an OPC-UA server is never going to be a simple task.