/// <summary> /// Dispose method. /// </summary> /// <param name="disposing"> /// True to release both managed and unmanaged resources.<para/> /// False to release unmanaged resources only. /// </param> protected virtual void Dispose(bool disposing) { if (disposing) { try { receiveThread.Abort(); } catch { } // Release managed resources. if (!rpceClient.IsDisposed) { rpceClient.Dispose(); } } // Release unmanaged resources. }
/// <summary> /// Dispose method. /// </summary> /// <param name="disposing"> /// True to release both managed and unmanaged resources.<para/> /// False to release unmanaged resources only. /// </param> protected virtual void Dispose(bool disposing) { if (disposing) { try { if (receiveTask != null && receiveTask.Status == TaskStatus.Running) { cancellationToken.Cancel(); } receiveTask.Dispose(); } catch { } // Release managed resources. if (!rpceClient.IsDisposed) { rpceClient.Dispose(); } } }