kcp.net icon indicating copy to clipboard operation
kcp.net copied to clipboard

发送2048长度的数据包会报错

Open a11s opened this issue 8 years ago • 0 comments

我测试发送一个较大的数据包,比如2048会报错. 发现是send的时候size计算有误. 我自己修改之后,size正确了, 测试了其他长度,比如60000,1024000传输不正常 后续包无法正常收发,总是收到一个24字节的反馈.没有数据.剩下的我就不会修改了.

未处理System.ArgumentException HResult=-2147024809 Message=源数组长度不足。请检查 srcIndex 和长度以及数组的下限。 ParamName="" Source=mscorlib StackTrace: 在 System.Array.Copy(Array sourceArray, Int32 sourceIndex, Array destinationArray, Int32 destinationIndex, Int32 length, Boolean reliable) 在 System.Array.Copy(Array sourceArray, Int32 sourceIndex, Array destinationArray, Int32 destinationIndex, Int32 length) 在 KCP.Common.KCPLib.Send(Byte[] buffer, Int32 index, Int32 bufsize) 位置 C:\Users\DongHanjun\Source\Repos\kcp.net\Kcp\Common\kcp_v2.cs:行号 407 在 KCP.Common.KCPLib.Send(Byte[] buffer) 位置 C:\Users\DongHanjun\Source\Repos\kcp.net\Kcp\Common\kcp_v2.cs:行号 418 在 KCP.Client.KCPClient.Send(Byte[] buf) 位置 C:\Users\DongHanjun\Source\Repos\kcp.net\Kcp\KCPClient.cs:行号 160 在 test_kcp_client.ClientState.client_Event(UdpClientEvents arg1, Byte[] arg2) 位置 C:\Users\DongHanjun\Source\Repos\kcp.net\test_kcp_client\Program.cs:行号 105 在 KCP.Client.KCPClient.process_recv_queue() 位置 C:\Users\DongHanjun\Source\Repos\kcp.net\Kcp\KCPClient.cs:行号 200 在 KCP.Client.KCPClient.update(UInt32 current) 位置 C:\Users\DongHanjun\Source\Repos\kcp.net\Kcp\KCPClient.cs:行号 238 在 KCP.Client.KCPClient.Update() 位置 C:\Users\DongHanjun\Source\Repos\kcp.net\Kcp\KCPClient.cs:行号 173 在 test_kcp_client.ClientState.Start(String host, UInt16 port, UInt32 index, Int32 key) 位置 C:\Users\DongHanjun\Source\Repos\kcp.net\test_kcp_client\Program.cs:行号 84 在 test_kcp_client.Program.<>c__DisplayClass0_0.<Main>b__2(Object _) 位置 C:\Users\DongHanjun\Source\Repos\kcp.net\test_kcp_client\Program.cs:行号 53 在 System.Threading.ThreadHelper.ThreadStart_Context(Object state) 在 System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx) 在 System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx) 在 System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state) 在 System.Threading.ThreadHelper.ThreadStart(Object obj) InnerException:

a11s avatar Oct 26 '16 09:10 a11s