mirror of
https://github.com/RRQM/TouchSocket.git
synced 2025-12-19 01:46:44 +08:00
修改:序列化方式由客户端动态指定。
增加:支持调用上下文。 增加:支持客户端动态指定调用实例。 增加:Channel联合使用。
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user