This project is read-only.
1
Vote

SntpClient.Completed not firing

description

In my Windows Phone 8 project I want to use your SntpClient. I have this code:
var client = new SntpClient();

            client.Completed += (s, e) =>
            {
                if (e.Error == System.Net.Sockets.SocketError.Success)
                {
                    System.Diagnostics.Debug.WriteLine("> Offset: " + e.Message.LocalClockOffset.TotalSeconds);
                }
            };

            var endpoint = new DnsEndPoint("time.windows.com", Constants.NtpPort);
            client.GetTimeAsync(endpoint);
The problem is, that the Completed-event is not being fired. So I never get any time offset. I tested my code with the following devices:
  • Emulator 8.0
  • Emulator 8.1
  • Samsung ATIV S (running OS 8.0 and connected to WiFi)
Did I do anything wrong?

comments