Refactoring and configure await false
This commit is contained in:
@@ -1,5 +1,4 @@
|
||||
using System;
|
||||
using System.Linq;
|
||||
using System.Net;
|
||||
using Example.Backend;
|
||||
using Example.Shared;
|
||||
@@ -21,13 +20,13 @@ class Program
|
||||
builder.Services.AddSingleton<IGatewayModule, NetworkGatewayModule>();
|
||||
builder.Services.AddSingleton<IUntrustedGateway, UdpGateway>();
|
||||
builder.Services.AddSingleton<IConnectionHub, ConnectionHub>();
|
||||
|
||||
builder.Services.AddOptions();
|
||||
var listening = new IPEndPoint(IPAddress.Any, 4567);
|
||||
|
||||
builder.Services.Configure<GatewayOptions>(options => options.Endpoint = listening);
|
||||
|
||||
builder.Services.Configure<DistributionOptions>(o => o.DistributionType = EDistributionType.Channeled);
|
||||
|
||||
builder.Services.AddSingleton<HubRequestExtractor>();
|
||||
|
||||
builder.Services.AddSingleton<IExecuteModule, BasicExecutionModule>();
|
||||
builder.Services.AddSingleton<IRepresentationModuleProducer, CreativeRepresentationModuleProducer>();
|
||||
builder.Services.AddSingleton<IInstanceRepository, RemoteInstanceRepository>();
|
||||
@@ -40,7 +39,6 @@ class Program
|
||||
return repo;
|
||||
}));
|
||||
|
||||
builder.Services.AddSingleton<IMessageDistributorFactory, ChannelDistributorFactory>();
|
||||
builder.Services.AddSingleton<IMethodRepository>(p =>
|
||||
{
|
||||
var methodRepo = new CollectableMethodRepository();
|
||||
@@ -52,17 +50,13 @@ class Program
|
||||
builder.Services.AddSingleton<ICancellationRepository, CancellationRepository>();
|
||||
|
||||
var host = builder.Build();
|
||||
host.Services.GetService<HubRequestExtractor>();
|
||||
//
|
||||
// builder.Build();
|
||||
new RemoteTypeBinder();
|
||||
new RemoteTypeBinder();
|
||||
//
|
||||
//
|
||||
_ = host.Services.GetService<IUntrustedGateway>()!.Start();
|
||||
var gateway = host.Services.GetService<IGatewayModule>();
|
||||
gateway.Run();
|
||||
|
||||
Console.ReadLine();
|
||||
_ = host.Services.GetService<IUntrustedGateway>()!.Start();
|
||||
var gateway = host.Services.GetService<IGatewayModule>();
|
||||
gateway.Run();
|
||||
|
||||
Console.ReadLine();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user