diff --git a/.vs/HaoYueNet/FileContentIndex/b26de889-019d-4af3-b6a2-172ab9c7804b.vsidx b/.vs/HaoYueNet/FileContentIndex/b26de889-019d-4af3-b6a2-172ab9c7804b.vsidx new file mode 100644 index 0000000..37a6416 Binary files /dev/null and b/.vs/HaoYueNet/FileContentIndex/b26de889-019d-4af3-b6a2-172ab9c7804b.vsidx differ diff --git a/.vs/HaoYueNet/FileContentIndex/d203a6c3-bb80-4fe8-8455-e254fded3140.vsidx b/.vs/HaoYueNet/FileContentIndex/d203a6c3-bb80-4fe8-8455-e254fded3140.vsidx deleted file mode 100644 index 4d94a67..0000000 Binary files a/.vs/HaoYueNet/FileContentIndex/d203a6c3-bb80-4fe8-8455-e254fded3140.vsidx and /dev/null differ diff --git a/README.md b/README.md index dc446d8..3d1fa42 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,26 @@ # HaoYueNet -.Net 6的,自建基于IOCP的TCP的高性能网络库 -使用Protobuff作为通讯协议 \ No newline at end of file +.Net 7 的,自建基于IOCP的TCP的高性能网络库 +使用Protobuff作为通讯协议 + +包含服务端和客户端双端库,可直接用于各类.Net程序或Unity程序,做TCP通讯底层库。 +不用关心网络底层,直接引用或继承,即可便捷使用。 + +DataCallBack//网络消息事件 +OnClose//连接关闭 + +并包含心跳包等检测、连接管理、Protobuff解析,优化后的高性能收发等等。 + +Simple目录下,有实例客户端和实例服务端, +示例中,使用本网络库,您可以继续示例项目写,也可以参照示例代码。 +示例中实现了: +事件机制, +客户端基本框架(连接管理,数据管理,消息收发,指定用户发送) +服务端基本框架(连接管理,用户管理,消息收发,指定用户发送,广播等) +简单无OAuth登录, +用户列表, +基础的Protobuff设计, +基础聊天功能, +整合Protobuff生成。 + +您甚至可以 \ No newline at end of file diff --git a/Simple/ServerCore/NetWork/IOCPNetWork.cs b/Simple/ServerCore/NetWork/IOCPNetWork.cs index 8eea172..c1c78e7 100644 --- a/Simple/ServerCore/NetWork/IOCPNetWork.cs +++ b/Simple/ServerCore/NetWork/IOCPNetWork.cs @@ -10,18 +10,7 @@ namespace ServerCore.NetWork public IOCPNetWork(int numConnections, int receiveBufferSize) : base(numConnections, receiveBufferSize) { - //m_clientCount = 0; - //m_maxConnectNum = numConnections; - //m_revBufferSize = receiveBufferSize; - //// allocate buffers such that the maximum number of sockets can have one outstanding read and - ////write posted to the socket simultaneously - //m_bufferManager = new BufferManager(receiveBufferSize * numConnections * opsToAlloc, receiveBufferSize); - //m_pool = new SocketEventPool(numConnections); - //m_maxNumberAcceptedClients = new Semaphore(numConnections, numConnections); - - ClientNumberChange += IOCPNetWork_ClientNumberChange; - } private void IOCPNetWork_ClientNumberChange(int num, AsyncUserToken token) @@ -72,6 +61,5 @@ namespace ServerCore.NetWork Console.WriteLine("断开连接"); ServerManager.g_ClientMgr.SetClientOfflineForSocket(sk); } - } }