class RemoteServer(BaseServer[
Constructor: RemoteServer(url, username, password, application_uri, ...)
The remote interface for a server-side Server.
After connecting to a server for the first time, its address space needs to be browsed. If your application only requires certain parts of the address space, i.e. only components, you can skip unnecessary browsing by setting the browse_* options of the constructor accordingly. This will speed up the browsing phase of the connection.
Note
Due to an asyncua limitation, custom data types are stored globally. Connections to servers with conflicting custom data types need isolation!
| Async Method | __aenter__ |
Enter the asynchronous context manager, connecting to the remote server. |
| Async Method | __aexit__ |
Exit the asynchronous context manager, disconnecting from the remote server. |
| Method | __init__ |
Create a new RemoteServer. Does not connect, call connect (or use async with) for that. |
| Async Method | connect |
Connect to the remote server, retrying if necessary (with Exponential backoff). |
| Async Method | disconnect |
Disconnect from the remote server. |
| Async Method | ua |
Undocumented |
| Class Variable | custom |
Undocumented |
| Instance Variable | init |
EXPERIMENTAL! List of collected exceptions that were not raised during initialization. |
| Instance Variable | logger |
Undocumented |
| Instance Variable | status |
Fired each time the status of the remote server is changed. |
| Instance Variable | subscription |
Undocumented |
| Instance Variable | time |
Fired each time the remote server time updates. Can be used for checking if the connection is alive. |
| Property | browse |
Browse rules for automatically recursively browsing the remote server. |
| Property | connected |
Whether we are currently connected to the remote machine. |
| Property | machines |
Provide all available machines in dictionary form using the name of the machine as the key. |
| Property | path |
Always /. |
| Property | status |
Return the status of the client. |
| Property | ua |
Return the internal OPC UA client. Make sure you know what you are doing. |
| Property | username |
Username used to connect to the remote server. |
| Async Method | _browse |
Iterate through all machines. |
| Async Method | _cancel |
Undocumented |
| Async Method | _connect |
Undocumented |
| Async Method | _connect |
Undocumented |
| Async Method | _init |
Undocumented |
| Async Method | _set |
Undocumented |
| Async Method | _set |
Undocumented |
| Async Method | _setup |
Undocumented |
| Async Method | _status |
Undocumented |
| Async Method | _teardown |
Best-effort return to DISCONNECTED. Safe to call repeatedly. |
| Async Method | _write |
Undocumented |
| Instance Variable | _application |
Undocumented |
| Instance Variable | _browse |
Undocumented |
| Instance Variable | _connect |
Undocumented |
| Instance Variable | _disconnect |
Undocumented |
| Instance Variable | _machines |
Undocumented |
| Instance Variable | _security |
Undocumented |
| Instance Variable | _state |
Undocumented |
| Instance Variable | _status |
Undocumented |
| Instance Variable | _suppress |
Used to suppress CONNECTED before BROWSING state from ua client. |
| Instance Variable | _ua |
Undocumented |
| Instance Variable | _ua |
Undocumented |
| Instance Variable | _username |
Undocumented |
str, *, username: str, password: str, application_uri: str | None = None, timeout: float = 10.0, watchdog_interval: float = 1.0, auto_reconnect: bool = True, reconnect_max_delay: float = 30.0, reconnect_request_timeout: float = 60.0, security_policy: SecurityPolicyType = SecurityPolicyType.NoSecurity, browse_rules: Iterable[ BrowseRule] | None = None, ua_publishing_interval_ms: int = 100):
¶
Create a new RemoteServer. Does not connect, call connect (or use async with) for that.
| Parameters | |
url:str | URL of the OPC UA server to connect to, e.g. opc.tcp://localhost:4843/ |
username:str | Username for authenticating with the server. |
password:str | Password for authenticating with the server. |
applicationstr | None | Globally unique application URI identifying this client (also used in the certificate when a security policy is set). A random urn:uuid:... is generated if None. |
timeout:float | Timeout in seconds for connection tries. |
watchdogfloat | Interval in seconds between connection liveness checks. |
autobool | Whether to automatically reconnect when the connection to the server is lost. |
reconnectfloat | How many seconds maximum to wait before reconnect (Exponential backoff). |
reconnectfloat | How long requests block waiting for the connection to be ready. |
securitySecurityPolicyType | OPC UA security policy used for the connection. Default: No security policy. |
browseIterable[ | The browse rules for automatic browsing. Browse everything by default (None), an empty iterable means browse nothing. |
uaint | Requested publishing interval, in milliseconds, for internal OPC UA subscriptions. May be revised by the server. |
int | None = 3, min_delay_seconds: float = 0.5, max_delay_seconds: float = 30.0) -> Self:
¶
Connect to the remote server, retrying if necessary (with Exponential backoff).
| Parameters | |
maxint | None | How many times to retry connecting to the remote server. None means unlimited. |
minfloat | How many seconds to wait minimum before next reconnection attempt. |
maxfloat | How many seconds to wait maximum before next reconnection attempt. |
| Returns | |
Self | Undocumented |
| Raises | |
ConnectionError | if connection could not be established after max_retries. |
Fired each time the remote server time updates. Can be used for checking if the connection is alive.
int | None = 3, min_delay_seconds: float = 0.5, max_delay_seconds: float = 30.0):
¶
Undocumented