Component:WebsocketClient

From Resonite Wiki
Revision as of 19:26, 1 March 2024 by PJB (talk | contribs) (Automated: update component fields)
Component image 
Websocket Client component as seen in the Scene Inspector


Fields

Fields
Name Type Description
persistent Bool Determines whether or not this item will be saved to the server.
UpdateOrder Int Controls the order in which this component is updated.
Enabled Bool Controls whether or not this component is enabled.
URL Uri The Websocket server to target - either secure (wss://) or insecure (ws://)
HandlingUser direct UserRef
AccessReason String A descriptive string explaining why this connection request should be granted
ConnectRetryInterval Float How often to retry the connection, if it fails for reasons other than being rejected by the user.
IsConnected Bool A read-only value indicating if this client has successfully connected to the target specified in URL

Usage

This component must be used in conjunction with the Websocket Protoflux Nodes - it only exists to store state, and does not function on its own.

User should be a user that expects to be hosting the Websocket connection Assignments should generally be made in the following order, depending on which one is the most applicable:

  • The user wearing the avatar containing this Protoflux
  • A specifically defined user who is expected to be present for this connection to function
  • The user who spawned the object containing this Protoflux
  • The user who is currently interacting with the object
  • The host of the session

You should not select a user who is not expecting the object to connect to an external service. It is possible they will deny the connection (especially if AccessReason isn't sufficiently convincing), which will cause the connection to fail.

AccessReason should provide a clear and concise reason for wanting to connect to the external service - It should include an obvious title or description of the object that is attempting to establish the connection, so that the user is aware of what item in the world is prompting the connection.

The object should have some way of indicating that it did not successfully connect to the target service, and that it will not function as intended, if at all.

The websocket times out and disconnects if the remote server does not send any traffic (including heartbeat messages) at least every 60 seconds, for long running connections be sure to configure the keepalive interval on the server side.

Examples

Related Issues

Related Components