// Token: 0x0600615B RID: 24923 RVA: 0x0014B8F0 File Offset: 0x00149AF0 internal override void StopExecute() { base.StopExecute(); if (base.GotStopSignalFromTestCode) { CacheBroadcaster cacheBroadcaster = new CacheBroadcaster(9050U); cacheBroadcaster.BroadcastInvalidationMessage(null, new Guid[] { Guid.NewGuid() }); base.AsyncThread.Join(); } }
public CacheBroadcaster(uint broadcastPort) { if (!CacheBroadcaster.IsIPv6Only()) { this.msgSendSocket = new Socket(AddressFamily.InterNetwork, SocketType.Dgram, ProtocolType.Udp); this.msgSendEndPoint = new IPEndPoint(IPAddress.Broadcast, (int)broadcastPort); this.msgSendSocket.SetSocketOption(SocketOptionLevel.Socket, SocketOptionName.Broadcast, 1); return; } this.msgSendSocket = new Socket(AddressFamily.InterNetworkV6, SocketType.Dgram, ProtocolType.Udp); this.msgSendEndPoint = new IPEndPoint(IPAddress.Parse("ff02::1"), (int)broadcastPort); this.msgSendSocket.SetSocketOption(SocketOptionLevel.IPv6, SocketOptionName.AddMembership, new IPv6MulticastOption(IPAddress.Parse("ff02::1"))); }
public static bool IsIPv6Only() { if (CacheBroadcaster.isIpv6Only == null) { try { IPAddress[] localIPAddresses = CacheBroadcaster.GetLocalIPAddresses(); CacheBroadcaster.isIpv6Only = new bool?(!localIPAddresses.Any((IPAddress addr) => addr.AddressFamily == AddressFamily.InterNetwork)); } catch (Exception) { CacheBroadcaster.isIpv6Only = new bool?(false); } } return(CacheBroadcaster.isIpv6Only.Value); }
// Token: 0x06006157 RID: 24919 RVA: 0x0014B5F0 File Offset: 0x001497F0 public InvalidationRecvActivity(ProvisioningCache cache, uint recvPort) : base(cache) { if (!CacheBroadcaster.IsIPv6Only()) { this.msgReceiveSocket = new Socket(AddressFamily.InterNetwork, SocketType.Dgram, ProtocolType.Udp); this.msgReceiveEndPoint = new IPEndPoint(IPAddress.Any, (int)recvPort); } else { this.msgReceiveSocket = new Socket(AddressFamily.InterNetworkV6, SocketType.Dgram, ProtocolType.Udp); this.msgReceiveEndPoint = new IPEndPoint(IPAddress.IPv6Any, (int)recvPort); this.msgReceiveSocket.SetSocketOption(SocketOptionLevel.IPv6, SocketOptionName.AddMembership, new IPv6MulticastOption(IPAddress.Parse("ff02::1"))); } this.msgReceiveSocket.SetSocketOption(SocketOptionLevel.Socket, SocketOptionName.ReuseAddress, 1); this.msgReceiveSocket.Bind(this.msgReceiveEndPoint); this.recvBuffer = new byte[5000]; }