public void HandleAssetCallback(OpenMetaverse.UUID assetID, AssetRequestInfo data, Exception error) { //if not found and this is the first try, try the second server if (_secondReadServer != null && data.ServerNumber == 0) { data.ServerNumber++; _secondReadServer.RequestAsset(assetID, data); } else { if (error == null) { _assetReceiver.AssetNotFound(assetID, data); } else { _assetReceiver.AssetError(assetID, error, data); } } }
/// <summary> /// Requests and asset and responds asynchronously /// </summary> /// <param name="assetID"></param> /// <param name="args"></param> public void RequestAsset(OpenMetaverse.UUID assetID, AssetRequestInfo args) { _threadPool.QueueWorkItem(() => { try { AssetBase asset = GetAssetInternal(assetID); if (asset != null) { _receiver.AssetReceived(asset, args); } else { _receiver.AssetNotFound(assetID, args); } } catch (Exception e) { _receiver.AssetError(assetID, e, args); } }); }