private async void SendBroadcast()
{
try
{
// Get the current IP address.
string ipAddress = "";
foreach (Windows.Networking.HostName hostName in NetworkInformation.GetHostNames())
{
if (hostName.Type == Windows.Networking.HostNameType.Ipv4)
{
ipAddress = hostName.CanonicalName;
break;
}
}
if (ipAddress == "")
{
return;
}
// Update our current ip so we can filter our messages.
m_currentIp = ipAddress;
await SendMessage(ipAddress);
}
catch(Exception e)
{
System.Diagnostics.Debug.WriteLine("Exception in broadcast. Message: "+e.Message);
}
// Indicate we are done.
m_isRunning = false;
}