Пример #1
0
 public void Open()
 {
     lock (this.ThisLock)
     {
         this.addressChangeHelper = new AddressChangeHelper(new AddressChangeHelper.AddedChangedCallback(this.OnAddressChanged));
         this.localAddresses      = this.GetAddresses();
         if (Socket.OSSupportsIPv6)
         {
             this.ipv6Socket = new Socket(AddressFamily.InterNetworkV6, SocketType.Stream, ProtocolType.IP);
         }
         this.isOpen = true;
     }
 }
Пример #2
0
        public void Open()
        {
            lock (ThisLock)
            {
                Fx.Assert(!this.isOpen, "Helper not expected to be open");

                // Register for addr changed event and retrieve addresses from the system
                this.addressChangeHelper = new AddressChangeHelper(OnAddressChanged);
                this.localAddresses      = GetAddresses();
                if (Socket.OSSupportsIPv6)
                {
                    this.ipv6Socket = new Socket(AddressFamily.InterNetworkV6, SocketType.Stream, ProtocolType.IP);
                }
                this.isOpen = true;
            }
        }
Пример #3
0
 public void Close()
 {
     if (this.isOpen)
     {
         lock (this.ThisLock)
         {
             if (this.isOpen)
             {
                 this.addressChangeHelper.Unregister();
                 if (this.ipv6Socket != null)
                 {
                     this.ipv6Socket.Close();
                 }
                 this.isOpen = false;
                 this.addressChangeHelper = null;
             }
         }
     }
 }
 public void Close()
 {
     if (this.isOpen)
     {
         lock (this.ThisLock)
         {
             if (this.isOpen)
             {
                 this.addressChangeHelper.Unregister();
                 if (this.ipv6Socket != null)
                 {
                     this.ipv6Socket.Close();
                 }
                 this.isOpen = false;
                 this.addressChangeHelper = null;
             }
         }
     }
 }
 public void Open()
 {
     lock (this.ThisLock)
     {
         this.addressChangeHelper = new AddressChangeHelper(new AddressChangeHelper.AddedChangedCallback(this.OnAddressChanged));
         this.localAddresses = this.GetAddresses();
         if (Socket.OSSupportsIPv6)
         {
             this.ipv6Socket = new Socket(AddressFamily.InterNetworkV6, SocketType.Stream, ProtocolType.IP);
         }
         this.isOpen = true;
     }
 }
Пример #6
0
        public void Open()
        {
            lock (ThisLock)
            {
                Fx.Assert(!this.isOpen, "Helper not expected to be open");

                // Register for addr changed event and retrieve addresses from the system
                this.addressChangeHelper = new AddressChangeHelper(OnAddressChanged);
                this.localAddresses = GetAddresses();
                if (Socket.OSSupportsIPv6)
                {
                    this.ipv6Socket = new Socket(AddressFamily.InterNetworkV6, SocketType.Stream, ProtocolType.IP);
                }
                this.isOpen = true;
            }
        }