Skip to content

Commit d11b408

Browse files
author
Hiram
committed
modify logic
1 parent 35b16d0 commit d11b408

16 files changed

+125
-505
lines changed

src/HiSocket/HiSocket.csproj

+6-2
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,15 @@
3434
<Prefer32Bit>false</Prefer32Bit>
3535
</PropertyGroup>
3636
<ItemGroup>
37+
<Reference Include="HiFramework, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
38+
<HintPath>..\packages\HiFramework.1.0.1\lib\net35\HiFramework.dll</HintPath>
39+
</Reference>
3740
<Reference Include="HiFramework.Assert, Version=1.0.2.0, Culture=neutral, processorArchitecture=MSIL">
3841
<HintPath>..\packages\HiFramework.Assert.1.0.2\lib\net35\HiFramework.Assert.dll</HintPath>
3942
</Reference>
43+
<Reference Include="HiFramework.Core, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
44+
<HintPath>..\packages\HiFramework.Core.1.0.0\lib\net35\HiFramework.Core.dll</HintPath>
45+
</Reference>
4046
<Reference Include="System" />
4147
<Reference Include="System.Core" />
4248
<Reference Include="System.Xml.Linq" />
@@ -52,9 +58,7 @@
5258
<Compile Include="Plugin\Statistical\StatisticalPlugin.cs" />
5359
<Compile Include="TcpConnection\Socket\ByteBlockBuffer.cs" />
5460
<Compile Include="TcpConnection\Socket\ByteBlockOperator.cs" />
55-
<Compile Include="TcpConnection\Socket\CircalBuffer.cs" />
5661
<Compile Include="TcpConnection\Socket\IByteBlockBuffer.cs" />
57-
<Compile Include="TcpConnection\Socket\ICircleBuffer.cs" />
5862
<Compile Include="TcpConnection\Socket\ITcpSocket.cs" />
5963
<Compile Include="Properties\AssemblyInfo.cs" />
6064
<Compile Include="TcpConnection\Socket\ReadOperator.cs" />

src/HiSocket/IConnection.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,12 @@ public interface IConnection
1414
/// <summary>
1515
/// Trigger when send message
1616
/// </summary>
17-
event Action<byte[]> OnSend;//havent packed
17+
event Action<byte[]> OnSendMessage;
1818

1919
/// <summary>
2020
/// Trigger when recieve message
2121
/// </summary>
22-
event Action<byte[]> OnReceive;//already unpacked
22+
event Action<byte[]> OnReceiveMessage;
2323

2424
/// <summary>
2525
/// Add plugin to extend logic

src/HiSocket/Plugin/Statistical/StatisticalPlugin.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ public sealed class StatisticalPlugin : PluginBase
1919

2020
public StatisticalPlugin(string name) : base(name)
2121
{
22-
Connection.OnSend += x => { howManyBytesSend += x.Length; };
22+
Connection.OnSendMessage += x => { howManyBytesSend += x.Length; };
2323

2424
}
2525
}

src/HiSocket/TcpConnection/Pack/IPackage.cs

+4-4
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,15 @@ namespace HiSocket
1212
public interface IPackage
1313
{
1414
/// <summary>
15-
/// 在此处理接收到服务器数据后的拆包粘包
15+
/// Handle data receive from server
1616
/// </summary>
1717
/// <param name="bytes"></param>
18-
void Unpack(IByteArray source, Action<byte[]> unpackedHandler);
18+
void Unpack(byte[] source, Action<byte[]> onUnpacked);
1919

2020
/// <summary>
21-
/// 在此处理将要发送的数据添加长度消息id等
21+
/// handle data will send to server
2222
/// </summary>
2323
/// <param name="bytes"></param>
24-
void Pack(IByteArray source, Action<byte[]> packedHandler);
24+
void Pack(byte[] source, Action<byte[]> onPacked);
2525
}
2626
}

src/HiSocket/TcpConnection/Socket/CircalBuffer.cs

-309
This file was deleted.

0 commit comments

Comments
 (0)