Skip to content

Commit

Permalink
简化EncoderBase
Browse files Browse the repository at this point in the history
  • Loading branch information
猿人易 committed Oct 12, 2024
1 parent 32469e0 commit 849ca02
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 13 deletions.
2 changes: 1 addition & 1 deletion DH.NRemoting/DH.NRemoting.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@
</None>
</ItemGroup>
<ItemGroup>
<PackageReference Include="DH.NCore" Version="3.91.2024.1011-beta0123" />
<PackageReference Include="DH.NCore" Version="3.91.2024.1012-beta0231" />
</ItemGroup>

</Project>
8 changes: 4 additions & 4 deletions DH.NRemoting/IEncoder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ public abstract class EncoderBase
/// <param name="code"></param>
/// <param name="value"></param>
/// <returns></returns>
public virtual IOwnerPacket Encode(String action, Int32? code, IPacket? value)
public virtual IPacket Encode(String action, Int32? code, IPacket? value)
{
// 内存流,前面留空8字节用于协议头4字节(超长8字节)
//var ms = new MemoryStream();
Expand All @@ -97,10 +97,10 @@ public virtual IOwnerPacket Encode(String action, Int32? code, IPacket? value)
// 参数或结果。长度部分定长4字节
if (value != null) writer.Write(value.Total);

pk = pk.Slice(8, writer.Position - 8) as OwnerPacket;
if (value != null) pk.Next = value;
var pk2 = pk.Slice(8, writer.Position - 8);
if (value != null) pk2.Next = value;

return pk;
return pk2;
}

/// <summary>解码 请求/响应</summary>
Expand Down
8 changes: 4 additions & 4 deletions Samples/IoTZero/IoTZero.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,11 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="DH.NCube.Core" Version="3.91.2024.1010-beta0631" />
<PackageReference Include="DH.NIoT" Version="3.91.2024.1010-beta0640" />
<PackageReference Include="DH.NMQTT" Version="3.91.2024.1010-beta0639" />
<PackageReference Include="DH.NCube.Core" Version="3.91.2024.1011-beta0234" />
<PackageReference Include="DH.NIoT" Version="3.91.2024.1011-beta0226" />
<PackageReference Include="DH.NMQTT" Version="3.91.2024.1011-beta0554" />
<PackageReference Include="DH.NRedis" Version="3.91.2024.1010-beta0633" />
<PackageReference Include="DH.NStardust.Extensions" Version="3.91.2024.1010-beta0622" />
<PackageReference Include="DH.NStardust.Extensions" Version="3.91.2024.1011-beta0209" />
</ItemGroup>

<ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion Samples/Zero.RpcServer/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
var port = 8080;

// 实例化RPC服务端,指定端口,同时在Tcp/Udp/IPv4/IPv6上监听
var server = new ApiServer(port)
using var server = new ApiServer(port)
{
Name = "银河服务端",

Expand Down
2 changes: 1 addition & 1 deletion Samples/Zero.RpcServer/Zero.RpcServer.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
<ItemGroup>
<PackageReference Include="DH.NCode" Version="3.91.2024.1011-beta0131" />
<PackageReference Include="DH.NRedis" Version="3.91.2024.1010-beta0633" />
<PackageReference Include="DH.NStardust" Version="3.91.2024.1010-beta0622" />
<PackageReference Include="DH.NStardust" Version="3.91.2024.1011-beta0209" />
</ItemGroup>

<ItemGroup>
Expand Down
4 changes: 2 additions & 2 deletions Samples/ZeroServer/ZeroServer.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="DH.NCube.Core" Version="3.91.2024.1010-beta0631" />
<PackageReference Include="DH.NCube.Core" Version="3.91.2024.1011-beta0234" />
<PackageReference Include="DH.NRedis" Version="3.91.2024.1010-beta0633" />
<PackageReference Include="DH.NStardust.Extensions" Version="3.91.2024.1010-beta0622" />
<PackageReference Include="DH.NStardust.Extensions" Version="3.91.2024.1011-beta0209" />
</ItemGroup>

<ItemGroup>
Expand Down

0 comments on commit 849ca02

Please sign in to comment.