Jump to content

OpenSimulator Internals/Connector Architecture

From Open Simulator Technical Help
Revision as of 09:47, 22 June 2026 by Jwbshaw (talk | contribs) (Configuration examples updated to RegionAssetConnector, and Asset Connector added to See Also.)

OpenSimulator Internals/Connector Architecture

Overview

The connector handles network calls transparently. Calling code does not need to know whether the service is local (standalone) or remote (grid mode) -- the connector abstracts that distinction.

In standalone mode the connector calls the service directly in-process. In grid mode it makes an HTTP call to ROBUST. Same interface either way.


The Five Components

Up to five components are involved in connecting simulator code to a grid service.

Component Location Description
Simulator code OpenSimulator core or a module Makes the initial service call to get or set data.
Simulator service connector OpenSim/Region/CoreModules/ServiceConnectorsOut (outbound), ServiceConnectorsIn (inbound) Two flavours: local (same process, standalone -- calls service directly) and remote (grid mode -- delegates to remote service connector for network call).
Remote service connector OpenSim/Services/Connectors Marshals data and makes the network call to the remote service. Not used for in-process connections.
Remote service handler OpenSim/Server/Handlers Unpacks the incoming network call and passes it to the service. Not used for in-process connections.
The service OpenSim/Services/[ServiceName] (e.g. OpenSim/Services/AssetService) Actually services the call and returns data.

Configuration

Note: In OpenSimulator 0.9.2, LocalAssetServiceConnector, RemoteAssetServiceConnector, and HGAssetBroker were replaced by a single module RegionAssetConnector. The examples below reflect the current architecture.

Standalone

Connectors and service in the same process:

[Modules]
AssetServices = "RegionAssetConnector"

[AssetService]
LocalGridAssetService = "OpenSim.Services.AssetService.dll:AssetService"

Grid

Service runs remotely on ROBUST:

[Modules]
AssetServices = "RegionAssetConnector"

[AssetService]
LocalGridAssetService = "OpenSim.Services.AssetService.dll:AssetService"
AssetServerURI = "http://myassetserver.com:8003"

Example: Asset Get

Standalone path

  1. Simulator calls Scene.AssetService.Get()
  2. Routes to RegionAssetConnector.Get()
  3. Checks cache
  4. On miss, calls AssetService.Get() directly in-process
  5. AssetService retrieves from persistent storage

Grid path

  1. Simulator calls Scene.AssetService.Get()
  2. Routes to RegionAssetConnector.Get()
  3. Delegates to AssetServicesConnector (OpenSim/Services/Connectors)
  4. Makes HTTP GET to http://yourassetserver/assets/assetId
  5. Received by OpenSim/Server/Handlers/Asset/AssetServerConnector
  6. AssetServerGetHandler unpacks request, calls AssetService
  7. Returns asset as XML on success, 404 on miss

HyperGrid path

  1. Simulator calls Scene.AssetService.Get()
  2. Routes to RegionAssetConnector.Get()
  3. RegionAssetConnector determines if asset is local or foreign grid
  4. Foreign: instantiates GridAssetClient for the foreign grid
  5. Makes HTTP GET to foreign asset server
  6. Asset copied to local asset table on retrieval -- same UUID, no link back

See Also