mirror of
https://github.com/esiur/esiur-dotnet.git
synced 2026-03-31 18:38:22 +00:00
renaming 2
This commit is contained in:
@@ -10,7 +10,7 @@ using static System.Runtime.InteropServices.JavaScript.JSType;
|
||||
namespace Test
|
||||
{
|
||||
[Resource]
|
||||
[Annotation("A", "B", "C", "D")]
|
||||
[Annotation("A", "B")]
|
||||
public partial class MyResource
|
||||
{
|
||||
[Export][Annotation("Comment")] string description;
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
using Esiur.Data;
|
||||
using Esiur.Core;
|
||||
using Esiur.Net.IIP;
|
||||
using Esiur.Resource;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using System.Threading;
|
||||
using Esiur.Protocol;
|
||||
|
||||
#nullable enable
|
||||
|
||||
@@ -183,12 +183,12 @@ public partial class MyService
|
||||
}
|
||||
|
||||
[Export]
|
||||
public void Connection(object a1, int a2, DistributedConnection a3) =>
|
||||
public void Connection(object a1, int a2, EpConnection a3) =>
|
||||
Console.WriteLine($"VoidArgs {a1} {a2} {a3}");
|
||||
|
||||
|
||||
[Export]
|
||||
public void ConnectionOptional(object a1, int a2, string a3 = "sss", DistributedConnection? a4 = null) =>
|
||||
public void ConnectionOptional(object a1, int a2, string a3 = "sss", EpConnection? a4 = null) =>
|
||||
Console.WriteLine($"VoidArgs {a1} {a2} {a3}");
|
||||
|
||||
[Export]
|
||||
|
||||
@@ -25,7 +25,6 @@ SOFTWARE.
|
||||
using Esiur.Data;
|
||||
using Esiur.Core;
|
||||
using Esiur.Net.HTTP;
|
||||
using Esiur.Net.IIP;
|
||||
using Esiur.Net.Sockets;
|
||||
using Esiur.Resource;
|
||||
using Esiur.Security.Permissions;
|
||||
@@ -49,6 +48,7 @@ using Esiur.Security.Cryptography;
|
||||
using Esiur.Security.Membership;
|
||||
using Esiur.Net.Packets;
|
||||
using System.Numerics;
|
||||
using Esiur.Protocol;
|
||||
|
||||
namespace Test
|
||||
{
|
||||
@@ -56,7 +56,7 @@ namespace Test
|
||||
class Program
|
||||
{
|
||||
|
||||
static void TestSerialization(object x, DistributedConnection connection = null)
|
||||
static void TestSerialization(object x, EpConnection connection = null)
|
||||
{
|
||||
|
||||
var d = Codec.Compose(x, Warehouse.Default, connection);
|
||||
@@ -145,7 +145,7 @@ namespace Test
|
||||
|
||||
// Create stores to keep objects.
|
||||
var system = await wh.Put("sys", new MemoryStore());
|
||||
var server = await wh.Put("sys/server", new DistributedServer() { Membership = membership });
|
||||
var server = await wh.Put("sys/server", new EpServer() { Membership = membership });
|
||||
|
||||
|
||||
var web = await wh.Put("sys/web", new HTTPServer() { Port = 8088 });
|
||||
@@ -158,7 +158,7 @@ namespace Test
|
||||
|
||||
//TestSerialization(res1);
|
||||
|
||||
server.MapCall("Hello", (string msg, DateTime time, DistributedConnection sender) =>
|
||||
server.MapCall("Hello", (string msg, DateTime time, EpConnection sender) =>
|
||||
{
|
||||
Console.WriteLine(msg);
|
||||
return "Hi " + DateTime.UtcNow;
|
||||
@@ -200,9 +200,9 @@ namespace Test
|
||||
|
||||
var format = x.RequiredFormat;
|
||||
|
||||
if (format == IIPAuthPacketIAuthFormat.Number)
|
||||
if (format == EpAuthPacketIAuthFormat.Number)
|
||||
return new AsyncReply<object>(Convert.ToInt32(10));
|
||||
else if (format == IIPAuthPacketIAuthFormat.Text)
|
||||
else if (format == EpAuthPacketIAuthFormat.Text)
|
||||
return new AsyncReply<object>(Console.ReadLine().Trim());
|
||||
|
||||
throw new NotImplementedException("Not supported format.");
|
||||
@@ -211,7 +211,7 @@ namespace Test
|
||||
private static async void TestClient(IResource local)
|
||||
{
|
||||
|
||||
var con = await new Warehouse().Get<DistributedConnection>("iip://localhost", new DistributedConnectionConfig
|
||||
var con = await new Warehouse().Get<EpConnection>("EP://localhost", new EpConnectionConfig
|
||||
{
|
||||
AutoReconnect = true,
|
||||
Username = "admin",
|
||||
@@ -258,11 +258,11 @@ namespace Test
|
||||
var t4 = await remote.GetTuple4(1, "A", 1.3, true);
|
||||
Console.WriteLine(t4);
|
||||
|
||||
remote.StringEvent += new DistributedResourceEvent((sender, args) =>
|
||||
remote.StringEvent += new EpResourceEvent((sender, args) =>
|
||||
Console.WriteLine($"StringEvent {args}")
|
||||
);
|
||||
|
||||
remote.ArrayEvent += new DistributedResourceEvent((sender, args) =>
|
||||
remote.ArrayEvent += new EpResourceEvent((sender, args) =>
|
||||
Console.WriteLine($"ArrayEvent {args}")
|
||||
);
|
||||
|
||||
@@ -270,7 +270,7 @@ namespace Test
|
||||
|
||||
|
||||
|
||||
//var path = TemplateGenerator.GetTemplate("iip://localhost/sys/service", "Generated");
|
||||
//var path = TemplateGenerator.GetTemplate("EP://localhost/sys/service", "Generated");
|
||||
|
||||
//Console.WriteLine(path);
|
||||
|
||||
@@ -295,7 +295,7 @@ namespace Test
|
||||
|
||||
static Timer perodicTimer;
|
||||
|
||||
static void TestObjectProps(IResource local, DistributedResource remote)
|
||||
static void TestObjectProps(IResource local, EpResource remote)
|
||||
{
|
||||
|
||||
foreach (var pt in local.Instance.Definition.Properties)
|
||||
@@ -333,6 +333,10 @@ namespace Test
|
||||
|
||||
return rt;
|
||||
}
|
||||
else if (value is Record)
|
||||
{
|
||||
return value.ToString();
|
||||
}
|
||||
else if (value is IRecord)
|
||||
{
|
||||
return "{" + String.Join(", ", t.GetProperties().Select(x => x.Name + ": " + x.GetValue(value))) + "}";
|
||||
|
||||
Reference in New Issue
Block a user