更新最新的5.0.4版本的HslCommunication组件,大幅度的提升了网络通信的效率及稳定性,后面计划完善web版及安卓。

This commit is contained in:
Richard.Hu
2018-04-30 00:09:05 +08:00
parent 90fc0d7f1a
commit 1fedeaae56
29 changed files with 209 additions and 221 deletions

View File

@@ -12,6 +12,7 @@ using System.Threading;
using HslCommunication;
using HslCommunication.Enthernet;
using HslCommunication.BasicFramework;
using HslCommunication.Core.Net;
using ClientsLibrary;
using HslCommunication.LogNet;
@@ -376,7 +377,7 @@ namespace 软件系统客户端模版
{
try
{
net_socket_client.KeyToken = UserSystem.KeyToken; // 新增的身份令牌
net_socket_client.Token = UserSystem.KeyToken; // 新增的身份令牌
net_socket_client.LogNet = UserClient.LogNet;
net_socket_client.EndPointServer = new System.Net.IPEndPoint(
System.Net.IPAddress.Parse(UserClient.ServerIp),
@@ -393,10 +394,10 @@ namespace 软件系统客户端模版
/// <summary>
/// 接收到服务器的字节数据的回调方法
/// </summary>
/// <param name="state">网络连接对象</param>
/// <param name="session">网络连接对象</param>
/// <param name="customer">用户自定义的指令头,用来区分数据用途</param>
/// <param name="data">数据</param>
private void Net_socket_client_AcceptString(AsyncStateOne state, NetHandle customer, string data)
private void Net_socket_client_AcceptString(AppSession session, NetHandle customer, string data)
{
if (customer == CommonHeadCode.MultiNetHeadCode.)
{
@@ -499,7 +500,7 @@ namespace 软件系统客户端模版
}
}
private void Net_socket_client_AcceptByte(AsyncStateOne object1, NetHandle customer, byte[] object2)
private void Net_socket_client_AcceptByte(AppSession session, NetHandle customer, byte[] object2)
{
// 接收到服务器发来的字节数据
if (IsHandleCreated) Invoke(new Action(() =>

View File

@@ -4,7 +4,7 @@
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-10.0.0.0" newVersion="10.0.0.0" />
<bindingRedirect oldVersion="0.0.0.0-11.0.0.0" newVersion="11.0.0.0" />
</dependentAssembly>
</assemblyBinding>
</runtime>

View File

@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="HslCommunication" version="4.3.0" targetFramework="net35" />
<package id="Newtonsoft.Json" version="10.0.3" targetFramework="net35" />
<package id="HslCommunication" version="5.0.4" targetFramework="net35" />
<package id="Newtonsoft.Json" version="11.0.2" targetFramework="net35" />
</packages>

View File

@@ -39,11 +39,11 @@
<Reference Include="CommonLibrary">
<HintPath>..\CommonLibrary\bin\Debug\CommonLibrary.dll</HintPath>
</Reference>
<Reference Include="HslCommunication, Version=4.3.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\HslCommunication.4.3.0\lib\net35\HslCommunication.dll</HintPath>
<Reference Include="HslCommunication, Version=5.0.4.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\HslCommunication.5.0.4\lib\net35\HslCommunication.dll</HintPath>
</Reference>
<Reference Include="Newtonsoft.Json, Version=10.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
<HintPath>..\packages\Newtonsoft.Json.10.0.3\lib\net35\Newtonsoft.Json.dll</HintPath>
<Reference Include="Newtonsoft.Json, Version=11.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
<HintPath>..\packages\Newtonsoft.Json.11.0.2\lib\net35\Newtonsoft.Json.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core" />