Skip to content

Commit

Permalink
调整网络模块
Browse files Browse the repository at this point in the history
  • Loading branch information
Jiang Yin committed Nov 14, 2019
1 parent 368dfba commit 5efccb1
Show file tree
Hide file tree
Showing 17 changed files with 793 additions and 682 deletions.
14 changes: 8 additions & 6 deletions GameFramework/GameFramework.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,7 @@
<Compile Include="Localization\LoadDictionaryUpdateEventArgs.cs" />
<Compile Include="Localization\LocalizationManager.cs" />
<Compile Include="Localization\LocalizationManager.LoadDictionaryInfo.cs" />
<Compile Include="Network\AddressFamily.cs" />
<Compile Include="Network\INetworkChannel.cs" />
<Compile Include="Network\INetworkChannelHelper.cs" />
<Compile Include="Network\INetworkManager.cs" />
Expand All @@ -165,15 +166,16 @@
<Compile Include="Network\NetworkCustomErrorEventArgs.cs" />
<Compile Include="Network\NetworkErrorCode.cs" />
<Compile Include="Network\NetworkErrorEventArgs.cs" />
<Compile Include="Network\NetworkManager.AsyncTcpNetworkChannel.cs" />
<Compile Include="Network\NetworkManager.ConnectState.cs" />
<Compile Include="Network\NetworkManager.cs" />
<Compile Include="Network\NetworkManager.NetworkChannel.ConnectState.cs" />
<Compile Include="Network\NetworkManager.NetworkChannel.cs" />
<Compile Include="Network\NetworkManager.NetworkChannel.HeartBeatState.cs" />
<Compile Include="Network\NetworkManager.NetworkChannel.ReceiveState.cs" />
<Compile Include="Network\NetworkManager.NetworkChannel.SendState.cs" />
<Compile Include="Network\NetworkManager.HeartBeatState.cs" />
<Compile Include="Network\NetworkManager.NetworkChannelBase.cs" />
<Compile Include="Network\NetworkManager.ReceiveState.cs" />
<Compile Include="Network\NetworkManager.SendState.cs" />
<Compile Include="Network\NetworkMissHeartBeatEventArgs.cs" />
<Compile Include="Network\NetworkType.cs" />
<Compile Include="Network\Packet.cs" />
<Compile Include="Network\ServiceType.cs" />
<Compile Include="ObjectPool\IObjectPool.cs" />
<Compile Include="ObjectPool\IObjectPoolManager.cs" />
<Compile Include="ObjectPool\ObjectBase.cs" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@
namespace GameFramework.Network
{
/// <summary>
/// 网络类型
/// 网络地址类型
/// </summary>
public enum NetworkType
public enum AddressFamily
{
/// <summary>
/// 未知。
Expand Down
12 changes: 10 additions & 2 deletions GameFramework/Network/INetworkChannel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,17 @@ bool Connected
}

/// <summary>
/// 获取网络类型
/// 获取网络服务类型
/// </summary>
NetworkType NetworkType
ServiceType ServiceType
{
get;
}

/// <summary>
/// 获取网络地址类型。
/// </summary>
AddressFamily AddressFamily
{
get;
}
Expand Down
3 changes: 2 additions & 1 deletion GameFramework/Network/INetworkManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -78,9 +78,10 @@ int NetworkChannelCount
/// 创建网络频道。
/// </summary>
/// <param name="name">网络频道名称。</param>
/// <param name="serviceType">网络服务类型。</param>
/// <param name="networkChannelHelper">网络频道辅助器。</param>
/// <returns>要创建的网络频道。</returns>
INetworkChannel CreateNetworkChannel(string name, INetworkChannelHelper networkChannelHelper);
INetworkChannel CreateNetworkChannel(string name, ServiceType serviceType, INetworkChannelHelper networkChannelHelper);

/// <summary>
/// 销毁网络频道。
Expand Down
24 changes: 12 additions & 12 deletions GameFramework/Network/NetworkErrorCode.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,33 +28,33 @@ public enum NetworkErrorCode
SocketError,

/// <summary>
/// 序列化错误
/// 连接错误
/// </summary>
SerializeError,
ConnectError,

/// <summary>
/// 反序列化消息包头错误
/// 发送错误
/// </summary>
DeserializePacketHeaderError,
SendError,

/// <summary>
/// 反序列化消息包错误
/// 接收错误
/// </summary>
DeserializePacketError,
ReceiveError,

/// <summary>
/// 连接错误
/// 序列化错误
/// </summary>
ConnectError,
SerializeError,

/// <summary>
/// 发送错误
/// 反序列化消息包头错误
/// </summary>
SendError,
DeserializePacketHeaderError,

/// <summary>
/// 接收错误
/// 反序列化消息包错误
/// </summary>
ReceiveError
DeserializePacketError
}
}
Loading

0 comments on commit 5efccb1

Please sign in to comment.