Connection Class |
Represents a connection from a OIV.RemoteViz.Rendering.Client to a OIV.RemoteViz.Rendering.RenderArea managed by the RemoteViz service.
Namespace: OIV.RemoteViz.Rendering
The Connection type exposes the following members.
Name | Description | |
---|---|---|
Close | Closes the connection. | |
Equals | Determines whether the specified Object is equal to the current Object. (Inherited from Object.) | |
GetHashCode |
Overrides GetHashCode().
(Inherited from SoNetBase.) | |
GetType | Gets the Type of the current instance. (Inherited from Object.) | |
SendMessage(IListByte) | Sends a binary message to the client. | |
SendMessage(String) | Sends a text message to the client. | |
ToString | Returns a string that represents the current object. (Inherited from Object.) |
Name | Description | |
---|---|---|
Client | Gets the client associated with this connection. | |
ContainerHeight | Gets the client container height. | |
ContainerWidth | Gets the client container width. | |
Id | Gets the id of the connection. | |
IsOpen | Gets the state of the OIV.RemoteViz.Rendering.Connection: open or closed. | |
LastEncodedFrame | Gets the last encoded frame sent by the connection. | |
Parameters | Gets the connection parameters. | |
RenderArea | Gets the OIV.RemoteViz.Rendering.RenderArea associated with the connection. | |
RequestedHeight | Gets the last renderArea height requested by the client. | |
RequestedWidth | Gets the last renderArea width requested by the client. | |
Settings | Gets the connection settings. |
A OIV.RemoteViz.Rendering.Connection object is created automatically by RemoteViz when a client connects to the service. Each connection belongs to a single OIV.RemoteViz.Rendering.Client and a single OIV.RemoteViz.Rendering.RenderArea. Each OIV.RemoteViz.Rendering.Client may have multiple connections, for example when multiple render areas are created on the same browser page. Each OIV.RemoteViz.Rendering.RenderArea may have multiple connections if it is shared, i.e. displayed in multiple client render areas. Use the OIV.RemoteViz.Rendering.Service object to query a client, then use the OIV.RemoteViz.Rendering.Client object to query its connections.
A OIV.RemoteViz.Rendering.Connection object is passed to many of the OIV.RemoteViz.Rendering.RenderAreaListener methods including onOpenedConnection(), onInitializedConnection() and onSendingFrame().
Using a OIV.RemoteViz.Rendering.Connection object, the application can query the current width and height of the client "container" in pixels and the last OIV.RemoteViz.Rendering.RenderArea width and height requested by the client. Note that the render area and the container are not required to be the same size. If the aspect ratios are different, then the rendered image will be displayed inside the container according to the "displayMode" specified when the client called the RemoteVizRenderArea constructor or set the 'displayMode' field of the OIV.RemoteViz.Clients.Nodes.SoRemoteVizClient node. Possible values are FIT (default), CROP and STRETCH.
A OIV.RemoteViz.Rendering.Connection allows the application to send text or binary messages to the associated client. A JavaScript client will receive the message using a listener (see the RemoteVizRenderArea method addServiceListener). Messages from a client are received using one of the OIV.RemoteViz.Rendering.RenderAreaListener.OnReceivedMessage(OIV.RemoteViz.Rendering.RenderArea, OIV.RemoteViz.Rendering.Connection, System.String) methods.