internal void OnException(Exception error)
{
// Will fire an exception listener callback if there's any set.
OnAsyncException(error);
if(!this.closing.Value && !this.closed.Value)
{
// Perform the actual work in another thread to avoid lock contention
// and allow the caller to continue on in its error cleanup.
executor.QueueUserWorkItem(AsyncOnExceptionHandler, error);
}
}