ChannelManagerBase.cs 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. //----------------------------------------------------------------------------
  2. // Copyright (c) Microsoft Corporation. All rights reserved.
  3. //----------------------------------------------------------------------------
  4. namespace System.ServiceModel.Channels
  5. {
  6. using System;
  7. using System.ServiceModel;
  8. using System.Collections.Generic;
  9. using System.Collections.ObjectModel;
  10. using System.Runtime.Serialization;
  11. using System.ServiceModel.Diagnostics;
  12. using System.Diagnostics;
  13. public abstract class ChannelManagerBase : CommunicationObject, IDefaultCommunicationTimeouts
  14. {
  15. protected ChannelManagerBase()
  16. {
  17. }
  18. protected abstract TimeSpan DefaultReceiveTimeout { get; }
  19. protected abstract TimeSpan DefaultSendTimeout { get; }
  20. internal TimeSpan InternalReceiveTimeout
  21. {
  22. get { return this.DefaultReceiveTimeout; }
  23. }
  24. internal TimeSpan InternalSendTimeout
  25. {
  26. get { return this.DefaultSendTimeout; }
  27. }
  28. TimeSpan IDefaultCommunicationTimeouts.CloseTimeout
  29. {
  30. get { return this.DefaultCloseTimeout; }
  31. }
  32. TimeSpan IDefaultCommunicationTimeouts.OpenTimeout
  33. {
  34. get { return this.DefaultOpenTimeout; }
  35. }
  36. TimeSpan IDefaultCommunicationTimeouts.ReceiveTimeout
  37. {
  38. get { return this.DefaultReceiveTimeout; }
  39. }
  40. TimeSpan IDefaultCommunicationTimeouts.SendTimeout
  41. {
  42. get { return this.DefaultSendTimeout; }
  43. }
  44. internal Exception CreateChannelTypeNotSupportedException(Type type)
  45. {
  46. return new ArgumentException(SR.GetString(SR.ChannelTypeNotSupported, type), "TChannel");
  47. }
  48. }
  49. }