Merge pull request #1 from Cyrus-Vance/patch-1

Update README.md
This commit is contained in:
akiragatsu 皓月狩魂 2024-01-08 15:35:33 +08:00 committed by GitHub
commit d3233eb056
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -44,11 +44,11 @@ OnReceive//收到网络数据
整合Protobuff生成。 整合Protobuff生成。
#最简接入示例(服务端和客户端) #最简接入示例(服务端和客户端)
若您的应用相对简单您甚至可以基于Simple增加功能快速达成目标. 若您的应用相对简单您甚至可以基于Sample增加功能快速达成目标.
Server: Server:
``` ```csharp
TcpSaeaServer Srv = new TcpSaeaServer(1024, 1024);//实例化,最大连接数和最大接收字节数 TcpSaeaServer Srv = new TcpSaeaServer(1024, 1024);//实例化,最大连接数和最大接收字节数
Srv.OnClientNumberChange += (int num, AsyncUserToken client) => { /* 连接数发生变化*/}; Srv.OnClientNumberChange += (int num, AsyncUserToken client) => { /* 连接数发生变化*/};
Srv.OnDisconnected += (AsyncUserToken client) => { /* 断开连接 */}; Srv.OnDisconnected += (AsyncUserToken client) => { /* 断开连接 */};
@ -64,7 +64,7 @@ Srv.Start(new IPEndPoint(IPAddress.Any.Address, 6000));//启动
Client: Client:
``` ```csharp
NetworkHelperCore network = new NetworkHelperCore(); NetworkHelperCore network = new NetworkHelperCore();
network.OnClose += ()=> { /* 断开连接 */}; network.OnClose += ()=> { /* 断开连接 */};
network.OnConnected += (bool IsConnect) => { /* 连接回到,成功或失败 */}; network.OnConnected += (bool IsConnect) => { /* 连接回到,成功或失败 */};