JsonRpc开发完成

This commit is contained in:
若汝棋茗
2021-05-20 00:24:18 +08:00
parent b18e955822
commit 63f3f0b067
30 changed files with 113 additions and 96 deletions

View File

@@ -76,7 +76,7 @@ namespace RRQMSocket.Http
{
this.URL = Uri.UnescapeDataString(first[1]);
this.RelativeURL = first[1].Split('?')[0];
}
}
if (first.Length > 2)
{
string[] ps = first[2].Split('/');
@@ -168,7 +168,7 @@ namespace RRQMSocket.Http
if (this.Content_Type == @"application/x-www-form-urlencoded")
{
this.Params = GetRequestParameters(this.BodyString);
}
}
}
}

View File

@@ -11,7 +11,6 @@
//------------------------------------------------------------------------------
using RRQMCore.Helper;
using System;
using System.IO;
namespace RRQMSocket.Http
{
@@ -76,7 +75,7 @@ namespace RRQMSocket.Http
/// <param name="statusCode"></param>
/// <param name="text"></param>
/// <returns></returns>
public static HttpResponse FromText(this HttpResponse response, string text,string statusCode = "200")
public static HttpResponse FromText(this HttpResponse response, string text, string statusCode = "200")
{
response.SetContent(text);
response.Content_Type = "text/plain";
@@ -90,7 +89,7 @@ namespace RRQMSocket.Http
/// <param name="response"></param>
/// <param name="statusCode"></param>
/// <returns></returns>
public static HttpResponse FromSuccess(this HttpResponse response,string statusCode="200")
public static HttpResponse FromSuccess(this HttpResponse response, string statusCode = "200")
{
response.StatusCode = statusCode;
response.SetHeader(ResponseHeader.Server, $"RRQMSocket.Http {HttpResponse.ServerVersion}");

View File

@@ -17,7 +17,7 @@ namespace RRQMSocket.RPC.JsonRpc
/// <summary>
/// 服务映射图
/// </summary>
public class ActionMap: IEnumerable<KeyValuePair<string, MethodInstance>>
public class ActionMap : IEnumerable<KeyValuePair<string, MethodInstance>>
{
internal ActionMap()
{
@@ -59,7 +59,7 @@ namespace RRQMSocket.RPC.JsonRpc
/// <returns></returns>
public IEnumerator<KeyValuePair<string, MethodInstance>> GetEnumerator()
{
return this.actionMap.GetEnumerator();
return this.actionMap.GetEnumerator();
}
IEnumerator IEnumerable.GetEnumerator()

View File

@@ -1,8 +1,14 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
//------------------------------------------------------------------------------
// 此代码版权归作者本人若汝棋茗所有
// 源代码使用协议遵循本仓库的开源协议及附加协议若本仓库没有设置则按MIT开源协议授权
// CSDN博客https://blog.csdn.net/qq_40374647
// 哔哩哔哩视频https://space.bilibili.com/94253567
// Gitee源代码仓库https://gitee.com/RRQM_Home
// Github源代码仓库https://github.com/RRQM
// 交流QQ群234762506
// 感谢您的下载和使用
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
namespace RRQMSocket.RPC.JsonRpc
{
@@ -11,11 +17,11 @@ namespace RRQMSocket.RPC.JsonRpc
/// </summary>
public class RpcRequestContext
{
#pragma warning disable CS1591
#pragma warning disable CS1591
public string jsonrpc;
public string method;
public object[] @params;
public string id;
#pragma warning restore CS1591
#pragma warning restore CS1591
}
}
}

View File

@@ -11,6 +11,7 @@
//------------------------------------------------------------------------------
using RRQMCore.ByteManager;
using RRQMCore.Exceptions;
using RRQMCore.Helper;
using RRQMCore.Log;
using System;
using System.IO;
@@ -18,7 +19,6 @@ using System.Net;
using System.Net.Sockets;
using System.Runtime.Serialization.Json;
using System.Text;
using RRQMCore.Helper;
namespace RRQMSocket.RPC.JsonRpc
{
@@ -128,7 +128,7 @@ namespace RRQMSocket.RPC.JsonRpc
private void OnReceived(RRQMSocketClient socketClient, ByteBlock byteBlock, object obj)
{
MethodInvoker methodInvoker = new MethodInvoker();
methodInvoker.Flag = socketClient;
methodInvoker.Caller = socketClient;
MethodInstance methodInstance = null;
try
{
@@ -139,6 +139,7 @@ namespace RRQMSocket.RPC.JsonRpc
}
else if (methodInstance.IsEnable)
{
methodInvoker.Flag = context;
methodInvoker.Parameters = context.@params;
}
else
@@ -154,7 +155,6 @@ namespace RRQMSocket.RPC.JsonRpc
this.ExecuteMethod(methodInvoker, methodInstance);
}
/// <summary>
/// 结束调用
/// </summary>
@@ -162,10 +162,27 @@ namespace RRQMSocket.RPC.JsonRpc
/// <param name="methodInstance"></param>
protected sealed override void EndInvokeMethod(MethodInvoker methodInvoker, MethodInstance methodInstance)
{
ISocketClient socketClient = (ISocketClient)methodInvoker.Caller;
ByteBlock byteBlock = this.BytePool.GetByteBlock(this.BufferLength);
this.BuildResponseByteBlock(byteBlock, methodInvoker, (RpcRequestContext)methodInvoker.Flag);
if (socketClient.Online)
{
try
{
socketClient.Send(byteBlock);
}
catch (Exception ex)
{
this.Logger.Debug(LogType.Error, this, ex.Message);
}
finally
{
byteBlock.Dispose();
}
}
}
/// <summary>
/// 初始化
/// </summary>
@@ -192,7 +209,6 @@ namespace RRQMSocket.RPC.JsonRpc
{
throw new RRQMRPCException($"函数键为{actionKey}的方法已注册。");
}
}
}
}
@@ -238,13 +254,37 @@ namespace RRQMSocket.RPC.JsonRpc
return context;
}
protected virtual
/// <summary>
/// 构建响应数据
/// </summary>
/// <param name="responseByteBlock"></param>
/// <param name="methodInvoker"></param>
/// <param name="context"></param>
protected virtual void BuildResponseByteBlock(ByteBlock responseByteBlock, MethodInvoker methodInvoker, RpcRequestContext context)
{
if (string.IsNullOrEmpty(context.id))
{
return;
}
if (methodInvoker.ReturnParameter != null)
{
this.WriteObject(responseByteBlock, methodInvoker.ReturnParameter);
}
}
private object ReadObject(Type type, Stream stream)
{
DataContractJsonSerializer deseralizer = new DataContractJsonSerializer(typeof(RpcRequestContext));
DataContractJsonSerializer deseralizer = new DataContractJsonSerializer(type);
return deseralizer.ReadObject(stream);
}
private void WriteObject(Stream stream, object obj)
{
DataContractJsonSerializer deseralizer = new DataContractJsonSerializer(obj.GetType());
deseralizer.WriteObject(stream, obj);
}
/// <summary>
/// 释放资源
/// </summary>

View File

@@ -70,6 +70,6 @@
</None>
</ItemGroup>
<ItemGroup>
<PackageReference Include="RRQMSocket.RPC" Version="1.0.6" />
<PackageReference Include="RRQMSocket.RPC" Version="1.0.7" />
</ItemGroup>
</Project>

View File

@@ -16,7 +16,7 @@ namespace RRQMSocket.RPC.WebApi
/// <summary>
/// 适用于WebApi的路由标记
/// </summary>
[AttributeUsage(AttributeTargets.Class|AttributeTargets.Method, AllowMultiple = false, Inherited = false)]
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Method, AllowMultiple = false, Inherited = false)]
public sealed class RouteAttribute : RPCMethodAttribute
{
/// <summary>

View File

@@ -9,11 +9,6 @@
// 感谢您的下载和使用
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace RRQMSocket.RPC.WebApi
{
@@ -32,4 +27,4 @@ namespace RRQMSocket.RPC.WebApi
/// </summary>
public string Message { get; set; }
}
}
}

View File

@@ -17,7 +17,7 @@ namespace RRQMSocket.RPC.WebApi
/// <summary>
/// 路由映射图
/// </summary>
public class RouteMap: IEnumerable<KeyValuePair<string, MethodInstance>>
public class RouteMap : IEnumerable<KeyValuePair<string, MethodInstance>>
{
internal RouteMap()
{
@@ -59,7 +59,7 @@ namespace RRQMSocket.RPC.WebApi
/// <returns></returns>
public IEnumerator<KeyValuePair<string, MethodInstance>> GetEnumerator()
{
return this.routeMap.GetEnumerator();
return this.routeMap.GetEnumerator();
}
IEnumerator IEnumerable.GetEnumerator()

View File

@@ -32,6 +32,6 @@ namespace RRQMSocket.RPC.WebApi
/// <param name="httpRequest"></param>
/// <param name="methodInvoker"></param>
/// <param name="methodInstance"></param>
public abstract void OnPost(HttpRequest httpRequest,ref MethodInvoker methodInvoker, MethodInstance methodInstance);
public abstract void OnPost(HttpRequest httpRequest, ref MethodInvoker methodInvoker, MethodInstance methodInstance);
}
}

View File

@@ -50,13 +50,12 @@ namespace RRQMSocket.RPC.WebApi
}
case "application/xml":
{
if (methodInstance.Parameters.Length>0)
if (methodInstance.Parameters.Length > 0)
{
for (int i = 0; i < methodInstance.Parameters.Length; i++)
{
if (i==0)
if (i == 0)
{
methodInvoker.Parameters[i] = SerializeConvert.XmlDeserializeFromBytes(httpRequest.Body.ToArray(), methodInstance.ParameterTypes[0]);
}
else

View File

@@ -18,7 +18,6 @@ using System;
using System.Net;
using System.Net.Sockets;
using System.Reflection;
using System.Threading.Tasks;
namespace RRQMSocket.RPC.WebApi
{
@@ -161,7 +160,6 @@ namespace RRQMSocket.RPC.WebApi
methodInvoker.Parameters[i] = methodInstance.ParameterTypes[i].GetDefault();
}
}
}
break;
}

View File

@@ -17,7 +17,7 @@ namespace RRQMSocket.RPC.XmlRpc
/// <summary>
/// 服务映射图
/// </summary>
public class ActionMap: IEnumerable<KeyValuePair<string, MethodInstance>>
public class ActionMap : IEnumerable<KeyValuePair<string, MethodInstance>>
{
internal ActionMap()
{
@@ -59,7 +59,7 @@ namespace RRQMSocket.RPC.XmlRpc
/// <returns></returns>
public IEnumerator<KeyValuePair<string, MethodInstance>> GetEnumerator()
{
return this.actionMap.GetEnumerator();
return this.actionMap.GetEnumerator();
}
IEnumerator IEnumerable.GetEnumerator()

View File

@@ -11,19 +11,14 @@
//------------------------------------------------------------------------------
using RRQMCore.ByteManager;
using RRQMCore.Exceptions;
using RRQMCore.Helper;
using RRQMCore.Log;
using RRQMSocket.Http;
using System;
using System.Collections.Generic;
using System.Dynamic;
using System.Globalization;
using System.IO;
using System.Net;
using System.Net.Sockets;
using System.Reflection;
using System.Text;
using System.Threading.Tasks;
using System.Xml;
namespace RRQMSocket.RPC.XmlRpc
@@ -135,7 +130,7 @@ namespace RRQMSocket.RPC.XmlRpc
{
HttpRequest httpRequest = (HttpRequest)obj;
MethodInvoker methodInvoker = new MethodInvoker();
httpRequest.Flag = socketClient;
methodInvoker.Caller = socketClient;
methodInvoker.Flag = httpRequest;
XmlDocument xml = new XmlDocument();
@@ -247,7 +242,7 @@ namespace RRQMSocket.RPC.XmlRpc
protected override void EndInvokeMethod(MethodInvoker methodInvoker, MethodInstance methodInstance)
{
HttpRequest httpRequest = (HttpRequest)methodInvoker.Flag;
RRQMSocketClient socketClient = (RRQMSocketClient)httpRequest.Flag;
RRQMSocketClient socketClient = (RRQMSocketClient)methodInvoker.Caller;
HttpResponse httpResponse = new HttpResponse();
@@ -374,7 +369,6 @@ namespace RRQMSocket.RPC.XmlRpc
object oValue = propertyInfo.GetValue(value);
this.CreatResponse(xml, oValueElement, oValue);
}
}
}

View File

@@ -4,7 +4,7 @@
<ApplicationIcon>RRQM.ico</ApplicationIcon>
<SignAssembly>true</SignAssembly>
<AssemblyOriginatorKeyFile>RRQM.pfx</AssemblyOriginatorKeyFile>
<Version>1.0.0</Version>
<Version>1.0.1</Version>
<Company>若汝棋茗</Company>
<Copyright>Copyright © 2021 若汝棋茗</Copyright>
<Description>介绍这是一个扩展于RRQMSocket.RPC的XmlRpc组件可以通过该组件直接创建XmlRpc服务解析器让Web端、移动端可以跨语言调用RPC函数。功能支持XmlRpc全功能。
@@ -12,7 +12,7 @@
IntroductionThis is an XMLRPC component that extends RRQMSocket.rpc. You can create an XMLRPC service parser directly from this component, allowing both Web and mobile users to call RPC functions across languages. Features support the full functionality of XMLRPC.
更新说明:
初次版本发布
优化:调用逻辑
Demohttps://gitee.com/RRQM_OS/RRQMBox
APIhttps://gitee.com/RRQM_OS/RRQM/wikis/pages </Description>
@@ -67,6 +67,6 @@ APIhttps://gitee.com/RRQM_OS/RRQM/wikis/pages </Description>
</ItemGroup>
<ItemGroup>
<PackageReference Include="RRQMSocket.Http" Version="1.0.2" />
<PackageReference Include="RRQMSocket.RPC" Version="1.0.6" />
<PackageReference Include="RRQMSocket.RPC" Version="1.0.7" />
</ItemGroup>
</Project>

View File

@@ -10,7 +10,6 @@
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
using System;
using System.Collections.Generic;
using System.Reflection;
namespace RRQMSocket.RPC

View File

@@ -9,7 +9,6 @@
// 感谢您的下载和使用
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
using System;
using System.Collections;
using System.Collections.Generic;
@@ -28,7 +27,7 @@ namespace RRQMSocket.RPC
/// 值集合
/// </summary>
public ICollection<TValue> Values { get { return this.dic.Values; } }
/// <summary>
/// 键集合
/// </summary>
@@ -60,9 +59,9 @@ namespace RRQMSocket.RPC
/// <param name="key"></param>
/// <param name="value"></param>
/// <returns></returns>
public bool TryGetValue(TKey key,out TValue value)
public bool TryGetValue(TKey key, out TValue value)
{
return this.dic.TryGetValue(key,out value);
return this.dic.TryGetValue(key, out value);
}
/// <summary>

View File

@@ -210,7 +210,6 @@ namespace RRQMSocket.RPC
methodInstance.ReturnType = method.ReturnType;
}
if (parameters.Length == 0)
{
methodInstance.MethodToken = ++ExistReturnNullParameters;

View File

@@ -19,7 +19,6 @@ namespace RRQMSocket.RPC.RRQMRPC
[AttributeUsage(AttributeTargets.Method, AllowMultiple = false, Inherited = false)]
public sealed class RRQMRPCCallBackMethodAttribute : RPCMethodAttribute
{
/// <summary>
/// 构造函数
/// </summary>

View File

@@ -25,7 +25,7 @@ namespace RRQMSocket.RPC.RRQMRPC
/// <summary>
/// 集群RPC客户端
/// </summary>
public class RPCClient : IRPCClient
public class RPCClient : IRPCClient
{
/// <summary>
/// 构造函数
@@ -172,7 +172,6 @@ namespace RRQMSocket.RPC.RRQMRPC
throw new RRQMRPCException("已注册服务数量为0");
}
this.MethodMap = new MethodMap();
foreach (ServerProvider instance in this.ServerProviders)
@@ -242,7 +241,6 @@ namespace RRQMSocket.RPC.RRQMRPC
{
throw new RRQMRPCKeyException("MethodToken必须唯一");
}
}
}
}
@@ -323,6 +321,7 @@ namespace RRQMSocket.RPC.RRQMRPC
this.rpcJunctorPool.DestroyObject(rpcJunctor);
}
}
/// <summary>
/// 函数式调用
/// </summary>
@@ -339,7 +338,7 @@ namespace RRQMSocket.RPC.RRQMRPC
RpcJunctor rpcJunctor = this.GetRpcJunctor();
try
{
return rpcJunctor.Invoke(method, invokeOption,ref parameters);
return rpcJunctor.Invoke(method, invokeOption, ref parameters);
}
finally
{
@@ -470,7 +469,7 @@ namespace RRQMSocket.RPC.RRQMRPC
RPCClient client;
if (rpcDic.TryGetValue(iPHost, out client))
{
client.RPCInvoke(methodKey, invokeOption,parameters);
client.RPCInvoke(methodKey, invokeOption, parameters);
return;
}
client = new RPCClient();

View File

@@ -145,7 +145,7 @@ namespace RRQMSocket.RPC.RRQMRPC
/// <returns>服务器返回结果</returns>
public T RPCInvoke<T>(string method, InvokeOption invokeOption = null, params object[] parameters)
{
object result = this.Invoke(method, invokeOption,ref parameters);
object result = this.Invoke(method, invokeOption, ref parameters);
if (result != null)
{
return (T)result;
@@ -165,7 +165,7 @@ namespace RRQMSocket.RPC.RRQMRPC
/// <exception cref="RRQMException"></exception>
public void RPCInvoke(string method, InvokeOption invokeOption = null, params object[] parameters)
{
this.Invoke(method, invokeOption,ref parameters);
this.Invoke(method, invokeOption, ref parameters);
}
/// <summary>

View File

@@ -142,7 +142,6 @@ namespace RRQMSocket.RPC.RRQMRPC
}
if (parameters[i].ParameterType.Name.Contains("&"))
{
if (parameters[i].IsOut)
{
isOut = true;
@@ -225,7 +224,7 @@ namespace RRQMSocket.RPC.RRQMRPC
codeString.Append(string.Format("\"{0}\"", methodName));
codeString.AppendLine(",invokeOption,ref parameters);");
}
if (isOut||isRef)
if (isOut || isRef)
{
codeString.AppendLine("if(parameters!=null)");
codeString.AppendLine("{");
@@ -247,7 +246,6 @@ namespace RRQMSocket.RPC.RRQMRPC
}
codeString.AppendLine("}");
}
}
if (isReturn)
@@ -257,7 +255,7 @@ namespace RRQMSocket.RPC.RRQMRPC
codeString.AppendLine("}");
if (!isOut&&!isRef)//没有out或者ref
if (!isOut && !isRef)//没有out或者ref
{
if (method.ReturnType.Name == "Void")
{

View File

@@ -12,7 +12,6 @@
using System;
using System.Collections.Generic;
using System.Reflection;
using System.Text.RegularExpressions;
namespace RRQMSocket.RPC.RRQMRPC
{
@@ -87,8 +86,9 @@ namespace RRQMSocket.RPC.RRQMRPC
this.initialized = true;
}
const string list = "System.Collections.Generic.List";
const string dictionary = "System.Collections.Generic.Dictionary";
private const string list = "System.Collections.Generic.List";
private const string dictionary = "System.Collections.Generic.Dictionary";
private Type MethodGetType(string typeName)
{
if (this.typeDic != null && typeDic.ContainsKey(typeName))
@@ -129,6 +129,5 @@ namespace RRQMSocket.RPC.RRQMRPC
return type;
}
}
}

View File

@@ -9,13 +9,13 @@
// 感谢您的下载和使用
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
using RRQMCore.Helper;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using System.Text;
using System.Threading.Tasks;
using RRQMCore.Helper;
namespace RRQMSocket.RPC.RRQMRPC
{

View File

@@ -9,11 +9,6 @@
// 感谢您的下载和使用
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace RRQMSocket.RPC.RRQMRPC
{
@@ -22,6 +17,5 @@ namespace RRQMSocket.RPC.RRQMRPC
/// </summary>
public class RpcCallBackContext
{
}
}
}

View File

@@ -224,7 +224,7 @@ namespace RRQMSocket.RPC.RRQMRPC
/// </summary>
/// <param name="context"></param>
/// <param name="caller"></param>
protected virtual void ExecuteContext(RpcContext context,object caller)
protected virtual void ExecuteContext(RpcContext context, object caller)
{
MethodInvoker methodInvoker = new MethodInvoker();
methodInvoker.Caller = caller;

View File

@@ -137,7 +137,7 @@ namespace RRQMSocket.RPC.RRQMRPC
Logger.Debug(LogType.Error, this, $"错误代码: 110, 错误详情:{e.Message}");
}
break;
}
}
case 112:/*函数式调用返回*/
{
try
@@ -292,11 +292,11 @@ namespace RRQMSocket.RPC.RRQMRPC
/// <param name="invokeOption">调用设置</param>
/// <param name="parameters">参数</param>
/// <returns></returns>
public T CallBack<T>(string iDToken,int methodToken, InvokeOption invokeOption = null, params object[] parameters)
public T CallBack<T>(string iDToken, int methodToken, InvokeOption invokeOption = null, params object[] parameters)
{
if (this.Service.SocketClients.TryGetSocketClient(iDToken, out RPCSocketClient socketClient))
{
return socketClient.CallBack<T>(methodToken, invokeOption, parameters);
return socketClient.CallBack<T>(methodToken, invokeOption, parameters);
}
else
{
@@ -311,7 +311,7 @@ namespace RRQMSocket.RPC.RRQMRPC
/// <param name="methodToken">函数唯一标识</param>
/// <param name="invokeOption">调用设置</param>
/// <param name="parameters">参数</param>
public void CallBack(string iDToken,int methodToken, InvokeOption invokeOption = null, params object[] parameters)
public void CallBack(string iDToken, int methodToken, InvokeOption invokeOption = null, params object[] parameters)
{
if (this.Service.SocketClients.TryGetSocketClient(iDToken, out RPCSocketClient socketClient))
{

View File

@@ -49,7 +49,7 @@ namespace RRQMSocket.RPC.RRQMRPC
WaitBytes waitBytes = SerializeConvert.RRQMBinaryDeserialize<WaitBytes>(buffer, 4);
this.waitHandles.SetRun(waitBytes.Sign, waitBytes);
}
/// <summary>
/// 等待字节返回
/// </summary>
@@ -57,7 +57,7 @@ namespace RRQMSocket.RPC.RRQMRPC
/// <param name="r"></param>
internal void Agreement_112(byte[] buffer, int r)
{
RpcContext rpcContext = RpcContext.Deserialize(buffer,4);
RpcContext rpcContext = RpcContext.Deserialize(buffer, 4);
this.invokeWaitData.Set(rpcContext);
}
@@ -139,7 +139,7 @@ namespace RRQMSocket.RPC.RRQMRPC
List<byte[]> datas = new List<byte[]>();
foreach (object parameter in parameters)
{
datas.Add(SerializeConvert.RRQMBinarySerialize(parameter,true));
datas.Add(SerializeConvert.RRQMBinarySerialize(parameter, true));
}
invokeWaitData.WaitResult.ParametersBytes = datas;
invokeWaitData.WaitResult.Serialize(byteBlock);
@@ -176,7 +176,7 @@ namespace RRQMSocket.RPC.RRQMRPC
{
throw new RRQMRPCException($"调用异常,信息:{context.Message}");
}
try
{
return SerializeConvert.RRQMBinaryDeserialize<T>(context.ReturnParameterBytes, 0);
@@ -191,8 +191,8 @@ namespace RRQMSocket.RPC.RRQMRPC
return default(T);
}
}
}
}
/// <summary>
/// 回调RPC
/// </summary>
@@ -219,7 +219,7 @@ namespace RRQMSocket.RPC.RRQMRPC
List<byte[]> datas = new List<byte[]>();
foreach (object parameter in parameters)
{
datas.Add(SerializeConvert.RRQMBinarySerialize(parameter,true));
datas.Add(SerializeConvert.RRQMBinarySerialize(parameter, true));
}
invokeWaitData.WaitResult.ParametersBytes = datas;
invokeWaitData.WaitResult.Serialize(byteBlock);

View File

@@ -22,7 +22,7 @@ namespace RRQMSocket
/// <summary>
/// TCP客户端
/// </summary>
public class TcpClient : BaseSocket, IUserTcpClient, IHandleBuffer
public class TcpClient : BaseSocket, IUserTcpClient, IHandleBuffer
{
/// <summary>
/// 构造函数
@@ -286,7 +286,7 @@ namespace RRQMSocket
/// <param name="obj"></param>
protected virtual void HandleReceivedData(ByteBlock byteBlock, object obj)
{
this.OnReceived?.Invoke(this,byteBlock,obj);
this.OnReceived?.Invoke(this, byteBlock, obj);
}
/// <summary>

View File

@@ -22,7 +22,7 @@ namespace RRQMSocket
/// <summary>
/// 需要验证的TCP客户端
/// </summary>
public class TokenTcpClient : TcpClient
public class TokenTcpClient : TcpClient
{
/// <summary>
/// 构造函数