BlockingCollection Exception

Nov 10, 2012 at 3:57 AM

Hi,

 

got this exception :

 

System.AggregateException: A Task's exception(s) were not observed either by Waiting on the Task or accessing its Exception property. As a result, the unobserved exception was rethrown by the finalizer thread. ---> System.ObjectDisposedException: The collection has been disposed.
Object name: 'BlockingCollection'.
   at System.Collections.Concurrent.BlockingCollection`1.CheckDisposed()
   at SocketIOClient.Client.dequeuOutboundMessages() in f:\CodePlex\socketio4net\SocketIO\Client.cs:line 550
   at System.Threading.Tasks.Task.Execute()
   --- End of inner exception stack trace ---
   at System.Threading.Tasks.TaskExceptionHolder.Finalize()
---> (Inner Exception #0) System.ObjectDisposedException: The collection has been disposed.
Object name: 'BlockingCollection'.
   at System.Collections.Concurrent.BlockingCollection`1.CheckDisposed()
   at SocketIOClient.Client.dequeuOutboundMessages() in f:\CodePlex\socketio4net\SocketIO\Client.cs:line 550
   at System.Threading.Tasks.Task.Execute()<---

 

can you please check how it can be prevented ?

maybe i did something wrong, or perhaps your can do something in the provided library ?

 

thanks in advance

Nov 13, 2012 at 6:53 AM

Hi,

 

I just got this exception once again.

Can you please check what's the cause for it / can it be prevented ?

 

thanks a lot

Coordinator
Nov 13, 2012 at 11:24 AM

The error comes from closing the client while it's still trying to dequeue messages.  Even if I eat/hide the exception, it seems there is some other underlying problem you have going on, not sure what that is.

Nov 13, 2012 at 11:29 AM

well, if i am trying to close the client, the dequeue should handle it safely, no ?

i believe it shouldn't crash for such incident.

 

thanks for your assistance

Coordinator
Nov 13, 2012 at 11:44 AM

I've added into the issues section, and will release an update that corrects the exception from being thrown on close.