Subject: Xamarin iOS - DotNetty.Transport.Channels.ClosedChannelException
Hi,
I'm getting this exception generated intermittently I think when the app/phone goes into sleep mode. It's ahrd to recreate but my error log system is pickig them up.
I've added some code that tries to monitor when the app goes to sleep and disconnect the XmppClient which I think has caught a lot of these incidents, but some still seem to be slipping through.
It seems to be caused by the KeepAliveHandler. I was wondering if there was anythign I could lookat from the calling code (in the pipeline perhaps) or whether this was mode something that needed handling in the underlying code.
All the best,
Paul.
I'm getting this exception generated intermittently I think when the app/phone goes into sleep mode. It's ahrd to recreate but my error log system is pickig them up.
I've added some code that tries to monitor when the app goes to sleep and disconnect the XmppClient which I think has caught a lot of these incidents, but some still seem to be slipping through.
It seems to be caused by the KeepAliveHandler. I was wondering if there was anythign I could lookat from the calling code (in the pipeline perhaps) or whether this was mode something that needed handling in the underlying code.
Xamarin Exception Stack:
DotNetty.Transport.Channels.ClosedChannelException: I/O error occurred.
at Matrix.Network.Handlers.KeepAliveHandler+<>c__DisplayClass4_0.<ChannelActive>b__0 (System.Object state) <0x1075f9230 + 0x001bf> in <2b86b82b658d4c92bfd52eb72504d791#ce8736efb5b41d616940f6b40b6f6dce>:0
at System.Runtime.CompilerServices.AsyncMethodBuilderCore+<>c.<ThrowAsync>b__7_1 (System.Object state) <0x1016545d8 + 0x00067> in <218435b0f6654ac1ab0cdd176f26b9bd#ce8736efb5b41d616940f6b40b6f6dce>:0
at System.Threading.QueueUserWorkItemCallback.WaitCallback_Context (System.Object state) <0x1015e9790 + 0x0005b> in <218435b0f6654ac1ab0cdd176f26b9bd#ce8736efb5b41d616940f6b40b6f6dce>:0
at System.Threading.ExecutionContext.RunInternal (System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, System.Object state, System.Boolean preserveSyncCtx) <0x1015e2cf8 + 0x0015f> in <218435b0f6654ac1ab0cdd176f26b9bd#ce8736efb5b41d616940f6b40b6f6dce>:0
at System.Threading.ExecutionContext.Run (System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, System.Object state, System.Boolean preserveSyncCtx) <0x1015e2c3c + 0x00043> in <218435b0f6654ac1ab0cdd176f26b9bd#ce8736efb5b41d616940f6b40b6f6dce>:0
at System.Threading.QueueUserWorkItemCallback.System.Threading.IThreadPoolWorkItem.ExecuteWorkItem () <0x1015e96f0 + 0x00047> in <218435b0f6654ac1ab0cdd176f26b9bd#ce8736efb5b41d616940f6b40b6f6dce>:0
at System.Threading.ThreadPoolWorkQueue.Dispatch () <0x1013bc5c0 + 0x001e7> in <218435b0f6654ac1ab0cdd176f26b9bd#ce8736efb5b41d616940f6b40b6f6dce>:0
at ObjCRuntime.Runtime.ThreadPoolDispatcher (System.Func`1[TResult] callback) <0x1025c1fa4 + 0x00053> in <149d342757e54bfaa120bb42afe18369#ce8736efb5b41d616940f6b40b6f6dce>:0
at System.Threading._ThreadPoolWaitCallback.PerformWaitCallback () <0x1015e9588 + 0x00077> in <218435b0f6654ac1ab0cdd176f26b9bd#ce8736efb5b41d616940f6b40b6f6dce>:0
DotNetty.Transport.Channels.ClosedChannelException: I/O error occurred.
at Matrix.Network.Handlers.KeepAliveHandler+<>c__DisplayClass4_0.<ChannelActive>b__0 (System.Object state) <0x1075f9230 + 0x001bf> in <2b86b82b658d4c92bfd52eb72504d791#ce8736efb5b41d616940f6b40b6f6dce>:0
at System.Runtime.CompilerServices.AsyncMethodBuilderCore+<>c.<ThrowAsync>b__7_1 (System.Object state) <0x1016545d8 + 0x00067> in <218435b0f6654ac1ab0cdd176f26b9bd#ce8736efb5b41d616940f6b40b6f6dce>:0
at System.Threading.QueueUserWorkItemCallback.WaitCallback_Context (System.Object state) <0x1015e9790 + 0x0005b> in <218435b0f6654ac1ab0cdd176f26b9bd#ce8736efb5b41d616940f6b40b6f6dce>:0
at System.Threading.ExecutionContext.RunInternal (System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, System.Object state, System.Boolean preserveSyncCtx) <0x1015e2cf8 + 0x0015f> in <218435b0f6654ac1ab0cdd176f26b9bd#ce8736efb5b41d616940f6b40b6f6dce>:0
at System.Threading.ExecutionContext.Run (System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, System.Object state, System.Boolean preserveSyncCtx) <0x1015e2c3c + 0x00043> in <218435b0f6654ac1ab0cdd176f26b9bd#ce8736efb5b41d616940f6b40b6f6dce>:0
at System.Threading.QueueUserWorkItemCallback.System.Threading.IThreadPoolWorkItem.ExecuteWorkItem () <0x1015e96f0 + 0x00047> in <218435b0f6654ac1ab0cdd176f26b9bd#ce8736efb5b41d616940f6b40b6f6dce>:0
at System.Threading.ThreadPoolWorkQueue.Dispatch () <0x1013bc5c0 + 0x001e7> in <218435b0f6654ac1ab0cdd176f26b9bd#ce8736efb5b41d616940f6b40b6f6dce>:0
at ObjCRuntime.Runtime.ThreadPoolDispatcher (System.Func`1[TResult] callback) <0x1025c1fa4 + 0x00053> in <149d342757e54bfaa120bb42afe18369#ce8736efb5b41d616940f6b40b6f6dce>:0
at System.Threading._ThreadPoolWaitCallback.PerformWaitCallback () <0x1015e9588 + 0x00077> in <218435b0f6654ac1ab0cdd176f26b9bd#ce8736efb5b41d616940f6b40b6f6dce>:0
All the best,
Paul.