Example #1
0
        private static async void InitializeHttpListenerAsync()
        {
            var communicationInterface = new CommunicationsInterface();
            var allInterfaces          = communicationInterface.GetAllInterfaces();

            var firstUsableInterface = allInterfaces.FirstOrDefault(x => x.IpAddress == "10.10.13.204");

            HttpListener.StartTcpRequestListener(1900, communicationInterface: firstUsableInterface, allowMultipleBindToSamePort: true);
            HttpListener.StartTcpResponseListener(1901, communicationInterface: firstUsableInterface, allowMultipleBindToSamePort: true);
            HttpListener.StartUdpMulticastListener("239.255.255.250", 1900, communicationInterface: firstUsableInterface, allowMultipleBindToSamePort: true);
            HttpListener.StartUdpListener(1900, communicationInterface: firstUsableInterface, allowMultipleBindToSamePort: true);
        }