LingerOption.cs 664 B

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. //
  2. // System.Net.Sockets.LingerOption.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. // Encapsulates a linger option.
  14. // </remarks>
  15. public class LingerOption
  16. {
  17. // Don't change the names of these fields without also
  18. // changing socket-io.c in the runtime
  19. private bool enabled;
  20. protected int seconds;
  21. public LingerOption (bool enable, int secs)
  22. {
  23. enabled = enable;
  24. seconds = secs;
  25. }
  26. public bool Enabled
  27. {
  28. get { return enabled; }
  29. set { enabled = value; }
  30. }
  31. public int LingerTime
  32. {
  33. get { return seconds; }
  34. set { seconds = value; }
  35. }
  36. }
  37. }