API component that serves as entry point for the client-side Iray Bridge API.
More...
|
using | Self = Interface_declare< id1, ... > |
| Own type. More...
|
|
using | IID = Uuid_t< id1, ... > |
| Declares the interface ID (IID) of this interface. More...
|
|
using | IID = Uuid_t<0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0> |
| Declares the interface ID (IID) of this interface. More...
|
|
static bool | compare_iid (const Uuid &iid) |
| Compares the interface ID iid against the interface ID of this interface and of its ancestors. More...
|
|
static bool | compare_iid (const Uuid &iid) |
| Compares the interface ID iid against the interface ID of this interface. More...
|
|
API component that serves as entry point for the client-side Iray Bridge API.
This API component is provided by the iray_bridge_client
plugin.
virtual IIray_bridge_session * mi::bridge::IIray_bridge_client::get_session |
( |
const char * |
application_url, |
|
|
const char * |
security_token = nullptr |
|
) |
| |
|
pure virtual |
Returns a session to the provided Bridge application running on a Bridge server.
Bridge supports session sharing, so subsequent calls to this method with the same URL and security token will return an already existing valid session. The session will be considered the same if the URL and security token strings match exactly, otherwise a new session will be created. If a session is closed then calling get_session() with the same URL and security token will create a new session and attempt a new connection to the server.
This call will return a session immediately which will connect to the specified URL automatically in the background. To find out if the session is connected or if the connection fails add a session state callback by calling mi::bridge::IIray_bridge_session::add_session_state_callback(). This callback will be called immediately with the current state, and then when the state changes.
- Parameters
-
application_url | The WebSocket URL to the server-side Bridge application. If the HTTP server listens on host "somehost" and port 80, and the application path on the server side is set to "/myapp" , then the client will connect using the URL "ws://somehost:80/myapp" . If the connection is encrypted using the SSL protocol, then the prefix "wss" needs to be used instead of "ws" . Note that the port must be specified. The standard port for WebSockets is 80 and 443 for secure WebSockets. |
security_token | An optional security token that can be inspected by the server-side application to decide whether the session should be accepted or rejected. |
virtual Sint32 mi::bridge::IIray_bridge_client::set_application_url |
( |
const char * |
application_url | ) |
|
|
pure virtual |
Sets the default WebSocket URL to the server-side Iray Bridge application.
Bridge renderer contexts and snapshot contexts will use this address as a default if the context option "bridge_address"
has not already been set. Note that the default will be picked up only once on first render or first snapshot creation, and after this point the context will no longer look at this global setting.
Note that it is recommended to only use the context option "bridge_address"
instead of this global default. If the bridge address change then all the open contexts will need to be reconfigured with the new address.
- Parameters
-
application_url | The WebSocket URL to the server-side Iray Bridge application. If the HTTP server listens on host "somehost" and port 80, and the application path on the server side is set to "/myapp" , then the client will connect using the URL "ws://somehost:80/myapp" . If the connection is encrypted using the SSL protocol, then the prefix "wss" needs to be used instead of "ws" . Note that the port must be specified. The standard port for WebSockets is 80 and 443 for secure WebSockets.
Iray Bridge server instances running on the VCA use SSL, run on port 443, and use the application path "/bridge" . |
- Returns
- 0 on success, <0 for unspecified error.
- See also
- mi::bridge::IIray_bridge_server::create_application()
virtual Sint32 mi::bridge::IIray_bridge_client::set_security_token |
( |
const char * |
security_token | ) |
|
|
pure virtual |
Sets the security token to use when connecting the server-side Iray Bridge application.
Bridge renderer contexts and snapshot contexts will use this token as a default if the context option "bridge_security_token"
has not already been set. Note that the default will be picked up only once on first render or first snapshot creation, and after this point the context will no longer look at this global setting.
Note that it is recommended to only use the context option "bridge_security_token"
instead of this global default. If the token change then all the open contexts will need to be reconfigured with the new token.
- Parameters
-
security_token | The security token to set. |
- Returns
- 0 on success, <0 for unspecified error.