SignalR.Client => SelfHost
This commit is contained in:
@ -7,13 +7,20 @@ using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Text.Json;
|
||||
using System.Web.Http;
|
||||
using System.Web.Http.SelfHost;
|
||||
|
||||
namespace Adaptation.FileHandlers.MoveAllFiles;
|
||||
|
||||
public class FileRead : Shared.FileRead, IFileRead
|
||||
{
|
||||
|
||||
#nullable enable
|
||||
|
||||
private long? _TickOffset;
|
||||
private readonly HttpSelfHostServer? _HttpSelfHostServer;
|
||||
|
||||
public const string BarcodeHostFileShare = @"\\messv02ecc1.ec.local\EC_Metrology_Si\BarcodeHost\API"; // GetPropertyValue(cellInstanceConnectionName, modelObjectParameters, "BarcodeHost.FileShare");
|
||||
|
||||
public FileRead(ISMTP smtp, Dictionary<string, string> fileParameter, string cellInstanceName, int? connectionCount, string cellInstanceConnectionName, FileConnectorConfiguration fileConnectorConfiguration, string equipmentTypeName, string parameterizedModelObjectDefinitionType, IList<ModelObjectParameterDefinition> modelObjectParameters, string equipmentDictionaryName, Dictionary<string, List<long>> dummyRuns, Dictionary<long, List<string>> staticRuns, bool useCyclicalForDescription, bool isEAFHosted) :
|
||||
base(new Description(), false, smtp, fileParameter, cellInstanceName, connectionCount, cellInstanceConnectionName, fileConnectorConfiguration, equipmentTypeName, parameterizedModelObjectDefinitionType, modelObjectParameters, equipmentDictionaryName, dummyRuns, staticRuns, useCyclicalForDescription, isEAFHosted: connectionCount is null)
|
||||
@ -27,8 +34,22 @@ public class FileRead : Shared.FileRead, IFileRead
|
||||
throw new Exception(cellInstanceConnectionName);
|
||||
if (_IsDuplicator)
|
||||
throw new Exception(cellInstanceConnectionName);
|
||||
if (!_IsEAFHosted)
|
||||
_HttpSelfHostServer = null;
|
||||
else
|
||||
{
|
||||
// string propertyName = string.Concat("CellInstance.", cellInstanceName, ".HttpSelfHostConfiguration.BaseAddress");
|
||||
// string httpSelfHostConfigurationBaseAddress = GetPropertyValue(cellInstanceConnectionName, modelObjectParameters, propertyName);
|
||||
string httpSelfHostConfigurationBaseAddress = "http://localhost:8080/";
|
||||
HttpSelfHostConfiguration config = new(httpSelfHostConfigurationBaseAddress);
|
||||
_ = config.Routes.MapHttpRoute("API Default", "api/{controller}/{id}", new { id = RouteParameter.Optional });
|
||||
_HttpSelfHostServer = new(config);
|
||||
_HttpSelfHostServer.OpenAsync().Wait();
|
||||
}
|
||||
}
|
||||
|
||||
#nullable disable
|
||||
|
||||
void IFileRead.Move(Tuple<string, Test[], JsonElement[], List<FileInfo>> extractResults, Exception exception) => Move(extractResults);
|
||||
|
||||
void IFileRead.WaitForThread() => WaitForThread(thread: null, threadExceptions: null);
|
||||
|
Reference in New Issue
Block a user