public DiscoveryServer(DiscoveryMode mode)
{
m_mode = mode;
m_dataSocket = new DatagramSocket();
// Register for message callbacks. We do this both on the server and client
// so the client can invoke the server when it comes online.
m_dataSocket.MessageReceived += DataSocket_MessageRecieved;
new Task(async () =>
{
try
{
await m_dataSocket.BindServiceNameAsync(GLOW_SERVER_DISCOVER_PORT + "");
}
catch(Exception e)
{
System.Diagnostics.Debug.WriteLine("UDP unable to bind to port!. Message: " + e.Message);
}
}).Start();
}