初始化
This commit is contained in:
47
ConsoleApp2/Program.cs
Normal file
47
ConsoleApp2/Program.cs
Normal file
@@ -0,0 +1,47 @@
|
||||
using CommonEntity.RCUEntity;
|
||||
using IOT_JieKou;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
using Microsoft.Extensions.Hosting;
|
||||
using ViewModels;
|
||||
|
||||
namespace ConsoleApp2
|
||||
{
|
||||
internal class Program
|
||||
{
|
||||
static async Task Main(string[] args)
|
||||
{
|
||||
using var host = new HostBuilder()
|
||||
.UseOrleansClient(clientBuilder =>
|
||||
{
|
||||
clientBuilder
|
||||
.UseLocalhostClustering();
|
||||
})
|
||||
.Build();
|
||||
|
||||
await host.StartAsync();
|
||||
var client = host.Services.GetRequiredService<IClusterClient>();
|
||||
|
||||
RCU_UDPData_With_String a = new RCU_UDPData_With_String();
|
||||
a.hostnum = "1101_04_05";
|
||||
byte[] Y111 = Tools.HEXString2ByteArray("AA 55 3C 00 54 33 53 41 34 32 F8 3D 04 81 FC 01 01 A3 06 01 30 20 00 00 00 00 00 02 02 02 39 01 01 00 10 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 07 01 00 00 02 5B 0B 79 CF".Replace(" ", ""));
|
||||
a.data = Y111;
|
||||
a.endpoint = "127.0.0.1:3100";
|
||||
a.currenttimestamp = DateTimeOffset.Now.ToUnixTimeMilliseconds();
|
||||
|
||||
//for (int i = 0; i < 100000; i++)
|
||||
//{
|
||||
// int ooo = i;
|
||||
// Task.Run(() =>
|
||||
// {
|
||||
// var ccc1 = client.GetGrain<IDataTran>("1101_04_" + ooo.ToString());
|
||||
// ccc1.TongXin(a);
|
||||
// });
|
||||
//}
|
||||
|
||||
var ccc = client.GetGrain<IDataTran>("1101_04_05");
|
||||
await ccc.TongXin(a);
|
||||
Console.WriteLine("Hello, World!");
|
||||
Console.ReadKey();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user