SocketException.cs 778 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. //
  2. // System.Net.Sockets.NetworkStream.cs
  3. //
  4. // Author:
  5. // Dick Porter <[email protected]>
  6. //
  7. // (C) 2002 Ximian, Inc.
  8. //
  9. using System.Runtime.Serialization;
  10. using System.ComponentModel;
  11. using System.Runtime.CompilerServices;
  12. namespace System.Net.Sockets
  13. {
  14. [Serializable]
  15. public class SocketException : Win32Exception
  16. {
  17. [MethodImplAttribute(MethodImplOptions.InternalCall)]
  18. private static extern int WSAGetLastError_internal();
  19. public SocketException ()
  20. : base (WSAGetLastError_internal()) {
  21. }
  22. public SocketException (int error)
  23. : base (error) {
  24. }
  25. protected SocketException (SerializationInfo info,
  26. StreamingContext context)
  27. : base (info, context) {
  28. }
  29. public override int ErrorCode {
  30. get {
  31. return NativeErrorCode;
  32. }
  33. }
  34. }
  35. }