SilverlightShow: Windows Phone 7.5: Using sockets Comments http://www.silverlightshow.net/ Silverlight articles, Silverlight tutorials, Silverlight videos, Silverlight samples SilverlightShow.net http://www.rssboard.org/rss-specification Argotic Syndication Framework 2008.0.2.0, http://www.codeplex.com/Argotic en-US estoychev@completit.com (Emil Stoychev) Re: Windows Phone 7.5: Using sockets <p>How to Display the current time (hours, minutes, seconds). The display shall be updated (but not synchronized) each second For WINDOWS PHONE 7</p> <p> Using This Tine Servers</p> <p> * time1.ucla.edu<br /> <br />   * time.ien.it<br /> <br />   * time-nw.nist.gov</p> <p> </p> <p> </p> <p> </p> <p>Thanks in advance</p> G.Vedanaya http://www.silverlightshow.net/items/Windows-Phone-7.5-Using-sockets.aspx#comment8062 vedanayagan http://www.silverlightshow.net/items/Windows-Phone-7.5-Using-sockets.aspx Mon, 14 May 2012 13:37:15 GMT Re: Windows Phone 7.5: Using sockets <p>How to Display the current time (hours, minutes, seconds). The display shall be updated (but not synchronized) each second.</p> <p> Using This Tine Servers</p> <p> * time1.ucla.edu<br /> <br />   * time.ien.it<br /> <br />   * time-nw.nist.gov</p> <p> </p> <p> </p> <p> </p> <p>Thanks in advance</p> <p>G.Vedanayagam</p> <p> </p> <p> </p> <p> </p> <p> </p> <p> </p> <p> </p> <p> </p> <p> </p> http://www.silverlightshow.net/items/Windows-Phone-7.5-Using-sockets.aspx#comment8061 vedanayagan http://www.silverlightshow.net/items/Windows-Phone-7.5-Using-sockets.aspx Mon, 14 May 2012 13:36:15 GMT Re: Windows Phone 7.5: Using sockets <p>Hi Andrea!<br /> <br /> An NTP client is a very nice sample to demonstrate sockets programming, and your article (as always) is written very well. <br /> <br /> For those interested in more details on NTP, let me point out the recommended way to get the accurate time. The approach in the article to use the transmitted server time works for simple scenarios, but it does not take the transmission time into account (the time it takes for the NTP messages to be transferred over the network). For example, if the server is a large distance away from your current location, and/or if the network is slow, it may take up to seconds to receive the answer. Although the time server itself is really accurate in tracking the time (especially primary servers that directly sync with atomic clocks), this precision then is lost.<br /> <br /> To work around this issue, the messages send to and received from a time server contain several additional time stamps that are used to improve this situation a lot. The server records both the time when a client message arrives as well as the time when it sends out the response. The client on the other hand also tracks both the time it sends out the request, and the time when a response is received. With these four timestamps it's possible to get a very precise idea of _the offset_ the local clock on the client is running at, as (pseudo code):<br /> <br /> (ServerReceiveTimestamp - ClientSendTimestamp) - (ClientReceiveTimestamp - ServerSendTimestamp) / 2.0<br /> <br /> You can then correct the local time by adding the above offset to it (which of course might also be negative).<br /> <br /> If you're interested in a full implementation of (S)NTP according to RFC 5905 for Windows Phone 7, including a sample application that makes use of the above, you can take a look at my open source project "Phone Net Tools" here: <a href="http://phonenettools.codeplex.com/">http://phonenettools.codeplex.com/</a> - I've just checked in a minor fix for that very timestamp computation that was sitting on my hard disk for a while. The described way is very handy if you e.g. want to produce accurate timestamps on the phone to sync events between multiple devices or the device and desktop applications. In my experience, it's possible to achieve accuracy of the order of milliseconds with this.</p> <div><br /> </div> http://www.silverlightshow.net/items/Windows-Phone-7.5-Using-sockets.aspx#comment7419 MisterGoodcat http://www.silverlightshow.net/items/Windows-Phone-7.5-Using-sockets.aspx Wed, 18 Jan 2012 11:37:13 GMT