MulticastOption.cs 935 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. //
  2. // System.Net.Sockets.MulticastOption.cs
  3. //
  4. // Author:
  5. // Andrew Sutton
  6. //
  7. // (C) Andrew Sutton
  8. //
  9. using System;
  10. using System.Net;
  11. namespace System.Net.Sockets
  12. {
  13. // <remarks>
  14. // Encapsulates a multicast option
  15. // </remarks>
  16. public class MulticastOption
  17. {
  18. // Don't change the names of these fields without also
  19. // changing socket-io.c in the runtime
  20. private IPAddress group;
  21. protected IPAddress local;
  22. public MulticastOption (IPAddress grp)
  23. : this (grp, IPAddress.Any)
  24. {
  25. group = grp;
  26. }
  27. public MulticastOption (IPAddress grp, IPAddress addr)
  28. {
  29. if (grp == null)
  30. throw new ArgumentNullException ("grp");
  31. if (addr == null)
  32. throw new ArgumentNullException ("addr");
  33. group = grp;
  34. local = addr;
  35. }
  36. public IPAddress Group
  37. {
  38. get { return group; }
  39. set { group = value; }
  40. }
  41. public IPAddress LocalAddress
  42. {
  43. get { return local; }
  44. set { local = value; }
  45. }
  46. }
  47. }