public string FindLocalWlanAddress(bool ipv6) { testLogger.LogTrace("FindLocalWlanAddress"); string returnAddress = NetworkInterfaceDataPathTests.GetWirelessEndpoint(ipv6); testLogger.LogComment("FindLocalWlanAddress: {0}", returnAddress); testLogger.LogTrace("FindLocalWlanAddress Length: {0}", returnAddress.Length); return(returnAddress); }
public void Configure(TestMode testMode, Guid localInterfaceGuid, string address, bool ipv6, UInt16 port) { this.ipv6Mode = ipv6; localPort = port; if (testMode == TestMode.Wlan) { localAddress = NetworkInterfaceDataPathTests.GetWirelessEndpoint(ipv6Mode); } else { localAddress = NetworkInterfaceDataPathTests.GetLanEndpoint(ipv6Mode, localInterfaceGuid); } this.identifier = String.Format(CultureInfo.InvariantCulture, "{0}:{1}", localAddress, localPort); testLogger.LogComment("MulticastReceiver[{0}] local address", this.identifier); testLogger.LogTrace("Creating Multicast Receive Socket"); if (ipv6Mode) { if (testMode == TestMode.Wlan) { using (Wlan wlanApi = new Wlan()) { var wlanInterfaceList = wlanApi.EnumWlanInterfaces(); if (wlanInterfaceList.Count < 1) { throw new TestConfigException("No WLAN Interfaces were discovered. Ensure that WLAN interfaces are enabled, discoverable, and operational."); } var wlanInterface = wlanInterfaceList[0]; UInt32 wlanInterfaceIndex = NetworkInterfaceDataPathTests.GetNetworkIndex(wlanInterface.Id); listenSocket = sockets.CreateMulticastSocket(localAddress, localPort, address, port, wlanInterfaceIndex); } } else { UInt32 lanInterfaceIndex = NetworkInterfaceDataPathTests.GetNetworkIndex(localInterfaceGuid); listenSocket = sockets.CreateMulticastSocket(localAddress, localPort, address, port, lanInterfaceIndex); } } else { listenSocket = sockets.CreateMulticastSocket(localAddress, localPort, address, port); } }
public void Configure(TestMode testMode, Guid localInterfaceGuid, string address, bool ipv6, UInt16 port) { this.ipv6Mode = ipv6; localPort = port; if (testMode == TestMode.Wlan) { localAddress = NetworkInterfaceDataPathTests.GetWirelessEndpoint(ipv6Mode); } else { localAddress = NetworkInterfaceDataPathTests.GetLanEndpoint(ipv6Mode, localInterfaceGuid); } this.identifier = String.Format(CultureInfo.InvariantCulture, "{0}:{1}", localAddress, localPort); testLogger.LogComment("BroadcastReceiver[{0}] local address", this.identifier); listenSocket = sockets.CreateUdpSocket(localAddress, localPort, ipv6Mode); }
public void Configure(TestMode testMode, Guid localInterfaceGuid, string address, bool ipv6, UInt16 port) { this.ipv6Mode = ipv6; this.remoteAddress = address; this.remotePort = port; localPort = port; if (testMode == TestMode.Wlan) { localAddress = NetworkInterfaceDataPathTests.GetWirelessEndpoint(ipv6Mode); } else { localAddress = NetworkInterfaceDataPathTests.GetLanEndpoint(ipv6Mode, localInterfaceGuid); } this.identifier = String.Format(CultureInfo.InvariantCulture, "{0}:{1}", localAddress, localPort); testLogger.LogComment("BroadcastSender[{0}] Remote {1}:{2}", this.identifier, this.remoteAddress, this.remotePort); }