diff --git a/.vs/HaoYueNet/DesignTimeBuild/.dtbcache.v2 b/.vs/HaoYueNet/DesignTimeBuild/.dtbcache.v2 index ad2dd79..612bc9c 100644 Binary files a/.vs/HaoYueNet/DesignTimeBuild/.dtbcache.v2 and b/.vs/HaoYueNet/DesignTimeBuild/.dtbcache.v2 differ diff --git a/.vs/HaoYueNet/project-colors.json b/.vs/HaoYueNet/project-colors.json index d80be9a..05167ca 100644 --- a/.vs/HaoYueNet/project-colors.json +++ b/.vs/HaoYueNet/project-colors.json @@ -50,7 +50,32 @@ "ProjectGuid": "5559b94a-da9e-4cf7-b799-2bcaa1f11f49", "DisplayName": "SimpleServer", "ColorIndex": 9 + }, + "895995de-556a-437e-8e6f-1a1fe8736386": { + "ProjectGuid": "895995de-556a-437e-8e6f-1a1fe8736386", + "DisplayName": "HaoYueNet.ClientNetworkNet4x", + "ColorIndex": 10 + }, + "a2fe74e1-b743-11d0-ae1a-00a0c90fffc3": { + "ProjectGuid": "a2fe74e1-b743-11d0-ae1a-00a0c90fffc3", + "DisplayName": "杂项文件", + "ColorIndex": -1 + }, + "27e139e2-f5f5-47df-99d8-04dc7ebebeec": { + "ProjectGuid": "27e139e2-f5f5-47df-99d8-04dc7ebebeec", + "DisplayName": "HaoYueNet.ClientNetworkNet4x", + "ColorIndex": 11 + }, + "d0066c06-a89a-4e05-80e0-d8232fb0ff3c": { + "ProjectGuid": "d0066c06-a89a-4e05-80e0-d8232fb0ff3c", + "DisplayName": "NetLib", + "ColorIndex": 12 + }, + "a741610f-29b9-4f0e-9a3d-0b3e1318f031": { + "ProjectGuid": "a741610f-29b9-4f0e-9a3d-0b3e1318f031", + "DisplayName": "HaoYueNet.ClientNetworkNet4x", + "ColorIndex": 13 } }, - "NextColorIndex": 10 + "NextColorIndex": 14 } \ No newline at end of file diff --git a/HaoYueNet.sln b/HaoYueNet.sln index e6224d0..c0ce52c 100644 --- a/HaoYueNet.sln +++ b/HaoYueNet.sln @@ -15,7 +15,7 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SimpleClient", "Simple\Simp EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SimpleServer", "Simple\SimpleServer\SimpleServer.csproj", "{5559B94A-DA9E-4CF7-B799-2BCAA1F11F49}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HaoYueNet.ClientNetworkNet4x", "NetLib\HaoYueNet.ClientNetworkNet4x\HaoYueNet.ClientNetworkNet4x.csproj", "{27E139E2-F5F5-47DF-99D8-04DC7EBEBEEC}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HaoYueNet.ClientNetworkNet4x", "NetLib\HaoYueNet.ClientNetworkNet4x\HaoYueNet.ClientNetworkNet4x.csproj", "{A741610F-29B9-4F0E-9A3D-0B3E1318F031}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution @@ -39,10 +39,10 @@ Global {5559B94A-DA9E-4CF7-B799-2BCAA1F11F49}.Debug|Any CPU.Build.0 = Debug|Any CPU {5559B94A-DA9E-4CF7-B799-2BCAA1F11F49}.Release|Any CPU.ActiveCfg = Release|Any CPU {5559B94A-DA9E-4CF7-B799-2BCAA1F11F49}.Release|Any CPU.Build.0 = Release|Any CPU - {27E139E2-F5F5-47DF-99D8-04DC7EBEBEEC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {27E139E2-F5F5-47DF-99D8-04DC7EBEBEEC}.Debug|Any CPU.Build.0 = Debug|Any CPU - {27E139E2-F5F5-47DF-99D8-04DC7EBEBEEC}.Release|Any CPU.ActiveCfg = Release|Any CPU - {27E139E2-F5F5-47DF-99D8-04DC7EBEBEEC}.Release|Any CPU.Build.0 = Release|Any CPU + {A741610F-29B9-4F0E-9A3D-0B3E1318F031}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {A741610F-29B9-4F0E-9A3D-0B3E1318F031}.Debug|Any CPU.Build.0 = Debug|Any CPU + {A741610F-29B9-4F0E-9A3D-0B3E1318F031}.Release|Any CPU.ActiveCfg = Release|Any CPU + {A741610F-29B9-4F0E-9A3D-0B3E1318F031}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -52,7 +52,7 @@ Global {696F6AAE-2D41-48F7-8FCD-E95CFE2A6519} = {D0066C06-A89A-4E05-80E0-D8232FB0FF3C} {C558ACA4-E59E-4F4D-94B7-2B78DA272CF3} = {A2CAD164-0816-4D1D-9793-1B1F398C9D29} {5559B94A-DA9E-4CF7-B799-2BCAA1F11F49} = {A2CAD164-0816-4D1D-9793-1B1F398C9D29} - {27E139E2-F5F5-47DF-99D8-04DC7EBEBEEC} = {D0066C06-A89A-4E05-80E0-D8232FB0FF3C} + {A741610F-29B9-4F0E-9A3D-0B3E1318F031} = {D0066C06-A89A-4E05-80E0-D8232FB0FF3C} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {22107F03-013F-4871-AC8E-F082694E2679} diff --git a/NetLib/HaoYueNet.ClientNetwork/NetworkHelperCore.cs b/NetLib/HaoYueNet.ClientNetwork/NetworkHelperCore.cs index 364bcef..e83ceec 100644 --- a/NetLib/HaoYueNet.ClientNetwork/NetworkHelperCore.cs +++ b/NetLib/HaoYueNet.ClientNetwork/NetworkHelperCore.cs @@ -210,9 +210,9 @@ namespace HaoYueNet.ClientNetwork LogOut("关闭心跳包计数"); _heartTimer.Enabled = false; LogOut("关闭连接"); - OnClose(); //关闭Socket连接 client.Close(); + OnClose(); } diff --git a/NetLib/HaoYueNet.ClientNetworkNet4x/HaoYueNet.ClientNetworkNet4x.csproj b/NetLib/HaoYueNet.ClientNetworkNet4x/HaoYueNet.ClientNetworkNet4x.csproj index 01a126b..048926c 100644 --- a/NetLib/HaoYueNet.ClientNetworkNet4x/HaoYueNet.ClientNetworkNet4x.csproj +++ b/NetLib/HaoYueNet.ClientNetworkNet4x/HaoYueNet.ClientNetworkNet4x.csproj @@ -4,14 +4,15 @@ Debug AnyCPU - {27E139E2-F5F5-47DF-99D8-04DC7EBEBEEC} + {A741610F-29B9-4F0E-9A3D-0B3E1318F031} Library Properties HaoYueNet.ClientNetworkNet4x HaoYueNet.ClientNetworkNet4x - v4.8 + v4.5.2 512 true + true @@ -31,30 +32,12 @@ 4 - - ..\..\packages\protobuf-net.3.0.101\lib\net461\protobuf-net.dll - - - ..\..\packages\protobuf-net.Core.3.0.101\lib\net461\protobuf-net.Core.dll + + False + .\protobuf-net.dll - - ..\..\packages\System.Buffers.4.5.1\lib\net461\System.Buffers.dll - - - ..\..\packages\System.Collections.Immutable.1.7.1\lib\net461\System.Collections.Immutable.dll - - - ..\..\packages\System.Memory.4.5.4\lib\net461\System.Memory.dll - - - - ..\..\packages\System.Numerics.Vectors.4.5.0\lib\net46\System.Numerics.Vectors.dll - - - ..\..\packages\System.Runtime.CompilerServices.Unsafe.4.5.3\lib\net461\System.Runtime.CompilerServices.Unsafe.dll - @@ -68,7 +51,7 @@ - + \ No newline at end of file diff --git a/NetLib/HaoYueNet.ClientNetworkNet4x/NetworkHelperCore.cs b/NetLib/HaoYueNet.ClientNetworkNet4x/NetworkHelperCore.cs index 95f137e..911f662 100644 --- a/NetLib/HaoYueNet.ClientNetworkNet4x/NetworkHelperCore.cs +++ b/NetLib/HaoYueNet.ClientNetworkNet4x/NetworkHelperCore.cs @@ -210,9 +210,9 @@ namespace HaoYueNet.ClientNetworkNet4x LogOut("关闭心跳包计数"); _heartTimer.Enabled = false; LogOut("关闭连接"); - OnClose(); //关闭Socket连接 client.Close(); + OnClose(); } diff --git a/NetLib/HaoYueNet.ClientNetworkNet4x/Properties/AssemblyInfo.cs b/NetLib/HaoYueNet.ClientNetworkNet4x/Properties/AssemblyInfo.cs index 9b358e6..0e0b53f 100644 --- a/NetLib/HaoYueNet.ClientNetworkNet4x/Properties/AssemblyInfo.cs +++ b/NetLib/HaoYueNet.ClientNetworkNet4x/Properties/AssemblyInfo.cs @@ -20,7 +20,7 @@ using System.Runtime.InteropServices; [assembly: ComVisible(false)] // 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID -[assembly: Guid("27e139e2-f5f5-47df-99d8-04dc7ebebeec")] +[assembly: Guid("a741610f-29b9-4f0e-9a3d-0b3e1318f031")] // 程序集的版本信息由下列四个值组成: // diff --git a/NetLib/HaoYueNet.ClientNetworkNet4x/packages.config b/NetLib/HaoYueNet.ClientNetworkNet4x/packages.config deleted file mode 100644 index 244f32d..0000000 --- a/NetLib/HaoYueNet.ClientNetworkNet4x/packages.config +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - - - - \ No newline at end of file diff --git a/NetLib/HaoYueNet.ClientNetworkNet4x/protobuf-net.dll b/NetLib/HaoYueNet.ClientNetworkNet4x/protobuf-net.dll new file mode 100644 index 0000000..a50bb36 Binary files /dev/null and b/NetLib/HaoYueNet.ClientNetworkNet4x/protobuf-net.dll differ diff --git a/Simple/SimpleClient/Network/NetworkHelper.cs b/Simple/SimpleClient/Network/NetworkHelper.cs index 3120917..72b0c16 100644 --- a/Simple/SimpleClient/Network/NetworkHelper.cs +++ b/Simple/SimpleClient/Network/NetworkHelper.cs @@ -17,7 +17,7 @@ namespace SimpleClient //指定接收服务器数据事件 OnDataCallBack += GetDataCallBack; //断开连接 - OnClose += Close; + OnClose += OnConnectClose; //网络库调试信息输出事件,用于打印连接断开,收发事件 OnLogOut += NetworkDeBugLog; OnConnected += NetworkConnected; @@ -50,9 +50,8 @@ namespace SimpleClient /// 错误编号 /// 业务数据 public void GetDataCallBack(int CMDID, int ERRCODE, byte[] data) - { - Console.WriteLine("收到消息 CMDID =>" + CMDID + " ERRCODE =>" + ERRCODE + " 数据长度=>" + data.Length); + NetworkDeBugLog("收到消息 CMDID =>" + CMDID + " ERRCODE =>" + ERRCODE + " 数据长度=>" + data.Length); try { @@ -63,7 +62,7 @@ namespace SimpleClient } catch (Exception ex) { - Console.WriteLine("逻辑处理错误:" + ex.ToString()); + NetworkDeBugLog("逻辑处理错误:" + ex.ToString()); } } @@ -71,9 +70,9 @@ namespace SimpleClient /// /// 关闭连接 /// - public void Close() + public void OnConnectClose() { - Console.WriteLine("断开连接"); + NetworkDeBugLog("OnConnectClose"); } } }