title: UDP broadcast send not working in UWP
body: <p>I tried to create an UDP send and listen application with UWP based on <a href="https://github.com/Microsoft/Windows-universal-samples/blob/master/Samples/DatagramSocket/cs/Scenario5_MulticastAndBroadcast.xaml.cs" rel="nofollow">this source code</a>.</p>
  
  <p>It should work like this:</p>
  
  <ul>
  <li>Listen on port 8080 for messages</li>
  <li>Send message to the broadcast address</li>
  <li>Receive messages from another UDP server that listens for messages sent to the broadcast</li>
  </ul>
  
  <p>I have the <code>Listen</code> and <code>Send</code> methods.</p>
  
  <p><strong>Constructor</strong></p>
  
  <pre><code>public MainViewModel()
  {
     Listen();
     Send();
  }
  </code></pre>
  
  <p><strong>Listen</strong></p>
  
  <pre><code>private async void Listen()
      {
        listenerSocket = new DatagramSocket();
        listenerSocket.MessageReceived += (x, y) =&gt;
        {
          var a = "2";
        };
        await listenerSocket.BindServiceNameAsync("8080");
      }
  </code></pre>
  
  <p><strong>Send</strong></p>
  
  <pre><code>private async void Send()
      {
        IOutputStream outputStream;
        string localIPString = GetLocalIp();
        IPAddress localIP = IPAddress.Parse(localIPString);
        string subnetMaskString = "255.0.0.0";
        IPAddress subnetIP = IPAddress.Parse(subnetMaskString); 
        HostName remoteHostname = new HostName(GetBroadcastAddress(localIP, subnetIP).ToString());
        outputStream = await listenerSocket.GetOutputStreamAsync(remoteHostname, "8080");      
        DataWriter writer = new DataWriter(outputStream);
        writer.WriteString(localIPString);
        await writer.StoreAsync();
      }
  </code></pre>
  
  <p>It seems that the <em>broadcast</em> sending is not working.</p>
  
  <p>I have another program (written in Java) that also sends a message to the broadcast address, and <em>this listener</em> receives the messages sent back from the broadcast.</p>
  
  <p>What should I set to make the sending work?</p>