Client Server: implement ReverseConnection mechanism
Implement the Reverse Connection mechanism for both Client and Server. See OPC UA specification part 6 from 1.04 version.
Server:
- Add reverse connections configurations to connect to clients configured
- Establish socket connection and send ReverseHello on those configured reverse connections:
- Retry socket connection with delay until connection succeeded and send RHE
- Retry socket connection on SC establishment timeout after sending an RHE
- Establish a new socket connection on SC establishment to allow new connection from server
Client API changes:
- Add reverse endpoint configuration
- Add API to open / close reverse endpoint
- Modify "connect" API (ActivateSession, SendDiscovery) to allow reverse connection configuration with associated reverse endpoint
Client reverse connection mechanism:
- Open a reverse endpoint
- Call "connect" API (ActivateSession, SendDiscovery) with a secure channel configuration and associated reverse endpoint to use to wait server connection
- Reverse endpoint listener records the waiting secure connections requested by client
- On server connection to reverse endpoint:
- Accept connection if any client secure connection waits for server connection
- otherwise close the socket connection
- On RHE reception:
- If a waiting client secure connection is compatible with server info (ServerUri, Server endpointURL), associate secure connection, remove from waiting connection on reverse endpoint and send HEL as classic connection
- otherwise close the socket connection
- Close a reverse endpoint: it does not close the secure connections already established using this endpoint
Edited by Vincent Monfort