![]() |
VOOZH | about |
dotnet add package Kcp --version 2.7.0
NuGet\Install-Package Kcp -Version 2.7.0
<PackageReference Include="Kcp" Version="2.7.0" />
<PackageVersion Include="Kcp" Version="2.7.0" />Directory.Packages.props
<PackageReference Include="Kcp" />Project file
paket add Kcp --version 2.7.0
#r "nuget: Kcp, 2.7.0"
#:package Kcp@2.7.0
#addin nuget:?package=Kcp&version=2.7.0Install as a Cake Addin
#tool nuget:?package=Kcp&version=2.7.0Install as a Cake Tool
开箱即用。也可以使用 Nuget 搜索。
KcpCore<Segment> where Segment : IKcpSegmentKcpIO<Segment> : KcpCore<Segment>, IKcpIO where Segment : IKcpSegmentKcp<Segment> : KcpCore<Segment> where Segment:IKcpSegmentc: skywind3000 KCP
go: xtaci kcp-go
Span<byte>简单的说:
不能在线程1调用Recv/Update时,线程2也在调用Recv/Update。函数内部使用大量共享数据结构,如果加锁严重影响性能。
可以在线程1调用Send/Input时,线程2也在调用Send/Input。函数内部有锁。
不可以多个线程同时调用Recv 和 Update。在UnitTestProject1路径下执行 dotnet test 可进行多框架测试。(需要安装dotnetcoreSDK)
| 差异变化 | C版 | C#版 |
|---|---|---|
| 数据结构 | ||
| acklist | 数组 | ConcurrentQueue |
| snd_queue | 双向链表 | ConcurrentQueue |
| snd_buf | 双向链表 | LinkedList |
| rcv_buf | 双向链表 | LinkedList |
| rcv_queue | 双向链表 | List |
| -------------- | -------------- | -------------- |
| 回调函数 | 增加了RentBuffer回调,当KCP需要时可以从外部申请内存。 | |
| 多线程 | 增加了线程安全。 | |
| 流模式 | 由于数据结构变动,流模式不会填充当前未发送的最末的数据包。 | |
| interval最小间隔 | 10ms | 0ms(在特殊形况下允许CPU满负荷运转) |
| -------------- | -------------- | -------------- |
| API变动 | ||
| 增加大小端编码设置。默认小端编码。 | ||
| 增加TryRecv函数,当可以Recv时只peeksize一次。 | ||
| ikcp_ack_push | 删除了此函数(已内联) | |
| ikcp_ack_get | 删除了此函数(已内联) |
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net5.0 net5.0 was computed. net5.0-windows net5.0-windows was computed. net6.0 net6.0 is compatible. net6.0-android net6.0-android was computed. net6.0-ios net6.0-ios was computed. net6.0-maccatalyst net6.0-maccatalyst was computed. net6.0-macos net6.0-macos was computed. net6.0-tvos net6.0-tvos was computed. net6.0-windows net6.0-windows was computed. net7.0 net7.0 is compatible. net7.0-android net7.0-android was computed. net7.0-ios net7.0-ios was computed. net7.0-maccatalyst net7.0-maccatalyst was computed. net7.0-macos net7.0-macos was computed. net7.0-tvos net7.0-tvos was computed. net7.0-windows net7.0-windows was computed. net8.0 net8.0 is compatible. net8.0-android net8.0-android was computed. net8.0-browser net8.0-browser was computed. net8.0-ios net8.0-ios was computed. net8.0-maccatalyst net8.0-maccatalyst was computed. net8.0-macos net8.0-macos was computed. net8.0-tvos net8.0-tvos was computed. net8.0-windows net8.0-windows was computed. net9.0 net9.0 was computed. net9.0-android net9.0-android was computed. net9.0-browser net9.0-browser was computed. net9.0-ios net9.0-ios was computed. net9.0-maccatalyst net9.0-maccatalyst was computed. net9.0-macos net9.0-macos was computed. net9.0-tvos net9.0-tvos was computed. net9.0-windows net9.0-windows was computed. net10.0 net10.0 was computed. net10.0-android net10.0-android was computed. net10.0-browser net10.0-browser was computed. net10.0-ios net10.0-ios was computed. net10.0-maccatalyst net10.0-maccatalyst was computed. net10.0-macos net10.0-macos was computed. net10.0-tvos net10.0-tvos was computed. net10.0-windows net10.0-windows was computed. |
| .NET Core | netcoreapp1.0 netcoreapp1.0 was computed. netcoreapp1.1 netcoreapp1.1 was computed. netcoreapp2.0 netcoreapp2.0 was computed. netcoreapp2.1 netcoreapp2.1 was computed. netcoreapp2.2 netcoreapp2.2 was computed. netcoreapp3.0 netcoreapp3.0 was computed. netcoreapp3.1 netcoreapp3.1 was computed. |
| .NET Standard | netstandard1.1 netstandard1.1 is compatible. netstandard1.2 netstandard1.2 was computed. netstandard1.3 netstandard1.3 was computed. netstandard1.4 netstandard1.4 was computed. netstandard1.5 netstandard1.5 was computed. netstandard1.6 netstandard1.6 was computed. netstandard2.0 netstandard2.0 is compatible. netstandard2.1 netstandard2.1 is compatible. |
| .NET Framework | net45 net45 was computed. net451 net451 was computed. net452 net452 was computed. net46 net46 was computed. net461 net461 was computed. net462 net462 was computed. net463 net463 was computed. net47 net47 was computed. net471 net471 was computed. net472 net472 was computed. net48 net48 was computed. net481 net481 was computed. |
| MonoAndroid | monoandroid monoandroid was computed. |
| MonoMac | monomac monomac was computed. |
| MonoTouch | monotouch monotouch was computed. |
| Tizen | tizen30 tizen30 was computed. tizen40 tizen40 was computed. tizen60 tizen60 was computed. |
| Universal Windows Platform | uap uap was computed. uap10.0 uap10.0 was computed. |
| Windows Phone | wpa81 wpa81 was computed. |
| Windows Store | netcore netcore was computed. netcore45 netcore45 was computed. netcore451 netcore451 was computed. |
| Xamarin.iOS | xamarinios xamarinios was computed. |
| Xamarin.Mac | xamarinmac xamarinmac was computed. |
| Xamarin.TVOS | xamarintvos xamarintvos was computed. |
| Xamarin.WatchOS | xamarinwatchos xamarinwatchos was computed. |
Showing the top 5 NuGet packages that depend on Kcp:
| Package | Downloads |
|---|---|
|
EasySharpFrame
Simple Development! |
|
|
Megumin.Remote
NetRemoteStandard的一个实现。 |
|
|
KCPNet
基于UDP以及开源项目Protobuf实现的帧同步网络库 |
|
|
Lakona.Rpc.Transport.Kcp
KCP client/server transport implementations for Lakona.Rpc. |
|
|
GameFrameX.NetWork.Kcp
GameFrameX.NetWork.Kcp,GameFrameX 框架的 KCP 网络模块.框架文档主页: https://gameframex.doc.alianblank.com |
Showing the top 2 popular GitHub repositories that depend on Kcp:
| Repository | Stars |
|---|---|
|
KumoKyaku/Megumin.Net
应用程序和游戏网络模块解决方案
|
|
|
suxf/ECSharp
Easy .NET Develop Frame.
|
| Version | Downloads | Last Updated |
|---|---|---|
| 2.7.0 | 5,682 | 11/16/2023 |
| 2.6.3 | 664 | 7/12/2023 |
| 2.6.2 | 377 | 6/16/2023 |
| 2.6.1 | 2,454 | 1/12/2023 |
| 2.6.0 | 1,487 | 10/29/2022 |
| 2.5.2 | 1,105 | 10/14/2022 |
| 2.5.1 | 544 | 10/10/2022 |
| 2.5.0 | 588 | 10/10/2022 |
| 2.4.1 | 571 | 10/7/2022 |
| 2.4.0 | 1,786 | 8/17/2022 |
| 2.3.0 | 9,457 | 9/16/2021 |
| 2.2.2 | 813 | 3/9/2021 |
| 2.2.1 | 607 | 2/4/2021 |
| 2.2.0 | 653 | 1/13/2021 |
| 2.1.0 | 933 | 12/2/2020 |
| 2.0.0 | 13,305 | 12/9/2019 |
| 1.3.2 | 995 | 4/5/2019 |
| 1.3.1 | 895 | 3/2/2019 |
| 1.3.0 | 867 | 3/1/2019 |
| 1.2.0 | 1,103 | 2/23/2019 |