SocketException.cs 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  1. //
  2. // System.Net.Sockets.NetworkStream.cs
  3. //
  4. // Author:
  5. // Andrew Sutton
  6. //
  7. // (C) Andrew Sutton
  8. //
  9. using System;
  10. namespace System.Net.Sockets
  11. {
  12. // <remarks>
  13. // A socket exception. Does this REALLY need to
  14. // be derived from Win32Exception? It seems a
  15. // little lame.
  16. //
  17. // This needs some work...
  18. // </remarks>
  19. public class SocketException : Exception
  20. {
  21. protected int error_code;
  22. protected int native_code;
  23. protected string help_link;
  24. protected string message;
  25. public SocketException ()
  26. {
  27. error_code = 0;
  28. }
  29. public SocketException (int error)
  30. {
  31. error_code = error;
  32. }
  33. public SocketException (SerializationInfo info, StreamingContext cxt)
  34. {
  35. }
  36. public override int ErrorCode
  37. {
  38. get { return error_code; }
  39. }
  40. public override string HelpLink
  41. {
  42. get { return help_link; }
  43. set { help_link = value; }
  44. }
  45. public override Exception InnerException
  46. {
  47. get { return inner_exception }
  48. }
  49. public override string Message
  50. {
  51. get { return message; }
  52. }
  53. public override int NativeErrorCode
  54. {
  55. get { return native_code; }
  56. }
  57. public override string Source
  58. {
  59. get { return source; }
  60. }
  61. public override string StackTrace
  62. {
  63. get { return stack_trace; }
  64. }
  65. public override MethodBase TargetSite
  66. {
  67. get { return target_site; }
  68. }
  69. protected override int HResult
  70. {
  71. get { return hresult; }
  72. set { hresult = value; }
  73. }
  74. public override int GetHashCode()
  75. {
  76. return native_code;
  77. }
  78. public override void GetObjectData( SerializationInfo info, StreamingContext cxt )
  79. {
  80. // TODO: fill this in
  81. }
  82. public override string ToString()
  83. {
  84. return error_code + " " + help_link;
  85. }
  86. }
  87. }