Hi,
My game is running fine in Unity Editor, everything’s working as expected.
but right after I close a socket with function CloseAsync(), Console will show this error message
"System.Threading.Tasks.TaskCanceledException: A task was canceled." (full error message below)
Anyone know what’s the cause of this error and how to solve this?
Thanks in advance & Best regards,
Bodin
Click for full error Detail
DebuggerNotification (System.Threading.Tasks.Task task) [0x00028] in <695d1cc93cca45069c528c15c9fdd749>:0
at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd (System.Threading.Tasks.Task task) [0x00008] in <695d1cc93cca45069c528c15c9fdd749>:0
at System.Runtime.CompilerServices.TaskAwaiter.GetResult () [0x00000] in <695d1cc93cca45069c528c15c9fdd749>:0
at Nakama.Ninja.WebSockets.Internal.WebSocketFrameReader+d__2.MoveNext () [0x0035f] in :0
— End of stack trace from previous location where exception was thrown —
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x0000c] in <695d1cc93cca45069c528c15c9fdd749>:0
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Threading.Tasks.Task task) [0x0001a] in <695d1cc93cca45069c528c15c9fdd749>:0
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (System.Threading.Tasks.Task task) [0x00028] in <695d1cc93cca45069c528c15c9fdd749>:0
at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd (System.Threading.Tasks.Task task) [0x00008] in <695d1cc93cca45069c528c15c9fdd749>:0
at System.Runtime.CompilerServices.TaskAwaiter1[TResult].GetResult () [0x00000] in <695d1cc93cca45069c528c15c9fdd749>:0 at Nakama.Ninja.WebSockets.Internal.WebSocketImplementation+<ReceiveAsync>d__34.MoveNext () [0x00198] in <c17a258af24e4d289a30070aa95dc0df>:0 --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x0000c] in <695d1cc93cca45069c528c15c9fdd749>:0 at Nakama.Ninja.WebSockets.Internal.WebSocketImplementation+<ReceiveAsync>d__34.MoveNext () [0x004a7] in <c17a258af24e4d289a30070aa95dc0df>:0 --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x0000c] in <695d1cc93cca45069c528c15c9fdd749>:0 at Nakama.Ninja.WebSockets.Internal.WebSocketImplementation+<ReceiveAsync>d__34.MoveNext () [0x00909] in <c17a258af24e4d289a30070aa95dc0df>:0 --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x0000c] in <695d1cc93cca45069c528c15c9fdd749>:0 at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Threading.Tasks.Task task) [0x0001a] in <695d1cc93cca45069c528c15c9fdd749>:0 at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (System.Threading.Tasks.Task task) [0x00028] in <695d1cc93cca45069c528c15c9fdd749>:0 at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd (System.Threading.Tasks.Task task) [0x00008] in <695d1cc93cca45069c528c15c9fdd749>:0 at System.Runtime.CompilerServices.ConfiguredTaskAwaitable
1+ConfiguredTaskAwaiter[TResult].GetResult () [0x00000] in <695d1cc93cca45069c528c15c9fdd749>:0
at Nakama.WebSocketAdapter+d__35.MoveNext () [0x000c5] in :0
UnityEngine.Debug:LogError (object)
Nakama.Socket:<.ctor>b__75_2 (System.Exception)
Nakama.WebSocketAdapter/d__35:MoveNext ()
System.Runtime.CompilerServices.AsyncTaskMethodBuilder1<System.Net.WebSockets.WebSocketReceiveResult>:SetException (System.Exception) Nakama.Ninja.WebSockets.Internal.WebSocketImplementation/<ReceiveAsync>d__34:MoveNext () System.Runtime.CompilerServices.AsyncTaskMethodBuilder
1<Nakama.Ninja.WebSockets.Internal.WebSocketReadCursor>:SetException (System.Exception)
Nakama.Ninja.WebSockets.Internal.WebSocketFrameReader/d__2:MoveNext ()
System.Runtime.CompilerServices.AsyncTaskMethodBuilder:SetResult ()
Nakama.Ninja.WebSockets.Internal.BinaryReaderWriter/d__0:MoveNext ()
System.Threading._ThreadPoolWaitCallback:PerformWaitCallback ()