修改:序列化方式由客户端动态指定。

增加:支持调用上下文。
增加:支持客户端动态指定调用实例。
增加:Channel联合使用。
This commit is contained in:
若汝棋茗
2021-08-26 21:26:37 +08:00
parent 749b9c9fd2
commit e360b66726
37 changed files with 1451 additions and 904 deletions

View File

@@ -10,6 +10,7 @@
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
using System;
using System.Linq;
using System.Reflection;
namespace RRQMSocket.RPC
@@ -24,6 +25,11 @@ namespace RRQMSocket.RPC
/// </summary>
public IServerProvider Provider { get; internal set; }
/// <summary>
/// 实例类型
/// </summary>
public Type ProviderType { get; internal set; }
/// <summary>
/// RPC函数
/// </summary>
@@ -73,5 +79,25 @@ namespace RRQMSocket.RPC
/// 是否可用
/// </summary>
public bool IsEnable { get; internal set; }
/// <summary>
/// 函数标识
/// </summary>
public MethodFlags MethodFlags { get; internal set; }
/// <summary>
/// 获取指定类型属性标签
/// </summary>
/// <typeparam name="T"></typeparam>
/// <returns></returns>
public T GetAttribute<T>()
{
object attribute = this.RPCAttributes.FirstOrDefault((a) => { return a.GetType() == typeof(T); });
if (attribute == null)
{
return default;
}
return (T)attribute;
}
}
}