class documentation

class RemoteServer(BaseServer[RemoteUaObject], UaDataChangeSubscriber):

Constructor: RemoteServer(url, username, password, application_uri, ...)

View In Hierarchy

The remote interface for a server-side Server.

After connecting to a server for the first time, it's 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 connection speed.

Async Method __aenter__ Enter the asynchronous context manager.
Async Method __aexit__ Exit the asynchronous context manager and shut down the server.
Method __init__ Create new RemoteServer instance.
Async Method connect Connect to the remote server.
Async Method disconnect Disconnect from the remote server.
Async Method ua_on_data_change Undocumented
Instance Variable logger Undocumented
Instance Variable status_changed Fired each time the status of the remote server is changed.
Instance Variable subscription_manager Undocumented
Instance Variable time_updated Fired each time the remote server time updates. Can be used for checking if the connection is alive.
Property browse_rules Browse rules for automatically recursively browsing the remote server.
Property connected Whether we are currently connected to the remote module.
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_client 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_machines Iterate through all machines.
Async Method _connect Undocumented
Async Method _set_security Undocumented
Async Method _set_status Undocumented
Async Method _setup_subscriptions Undocumented
Async Method _status_update_loop Undocumented
Async Method _write_ua_client_state Undocumented
Instance Variable _application_uri Undocumented
Instance Variable _browse_rules Undocumented
Instance Variable _machines Undocumented
Instance Variable _security_policy Undocumented
Instance Variable _state_update_task Undocumented
Instance Variable _status Undocumented
Instance Variable _ua_client Undocumented
Instance Variable _ua_client_state_subscription Undocumented
Instance Variable _username Undocumented
async def __aenter__(self) -> Self:

Enter the asynchronous context manager.

async def __aexit__(self, exc_type, exc, tb):

Exit the asynchronous context manager and shut down the server.

def __init__(self, url: 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):

Create new RemoteServer instance.

Parameters
url:strThe URL of the OPC UA server to connect to, i.e. opc.tcp://localhost:4843/
username:strUsername used for authentication of the given OPC UA server.
password:strPassword used for authentication of the given OPC UA server.
application_uri:str | NoneUndocumented
timeout:floatTimeout in seconds for connection tries.
watchdog_interval:floatUndocumented
auto_reconnect:boolWhether to automatically reconnect when connection to remove server is lost.
reconnect_max_delay:floatHow many seconds maximum to wait before reconnect (Exponential backoff).
reconnect_request_timeout:floatHow long requests block waiting for the connection to be ready.
security_policy:SecurityPolicyTypeOPC UA security policy used for the connection. Default: No security policy.
browse_rules:Iterable[BrowseRule] | NoneThe browse rules for automatic browsing. Browse everything by default (None), an empty iterable means browse nothing.
async def connect(self, *, max_retries: int | None = 3) -> Self:

Connect to the remote server.

Raises
ConnectionErrorif connection could not be established after max_retries.
async def disconnect(self):

Disconnect from the remote server.

@override
async def ua_on_data_change(self, node: Node, val: Any, data: DataChangeNotif):

Undocumented

logger =

Undocumented

status_changed =

Fired each time the status of the remote server is changed.

subscription_manager =

Undocumented

time_updated =

Fired each time the remote server time updates. Can be used for checking if the connection is alive.

@property
browse_rules: tuple[BrowseRule, ...] =

Browse rules for automatically recursively browsing the remote server.

@property
connected: bool =

Whether we are currently connected to the remote module.

@property
machines: dict[str, RemoteMachine] =

Provide all available machines in dictionary form using the name of the machine as the key.

@property
path: PurePosixPath =

Always /.

@property
status: RemoteServerStatus =

Return the status of the client.

@property
ua_client: Client =

Return the internal OPC UA client. Make sure you know what you are doing.

@property
username: str =

Username used to connect to the remote server.

async def _browse_machines(self):

Iterate through all machines.

async def _connect(self):

Undocumented

async def _set_security(self):

Undocumented

async def _set_status(self, status: RemoteServerStatus):

Undocumented

async def _setup_subscriptions(self):

Undocumented

async def _status_update_loop(self) -> Never:

Undocumented

async def _write_ua_client_state(self, ua_client_state: UaClientState):

Undocumented

_application_uri: str =

Undocumented

_browse_rules: tuple[BrowseRule, ...] =

Undocumented

_machines: dict[str, RemoteMachine] =

Undocumented

_security_policy =

Undocumented

_state_update_task: Task[Never] =

Undocumented

_status =

Undocumented

_ua_client =

Undocumented

_ua_client_state_subscription =

Undocumented

_username: str =

Undocumented