none
WCF Channels and date/time change RRS feed

  • Question

  • Hi, I am using WCF on an embedded device (net.namedpipe) and have noticed "interesting" behavior when the date and/or time on the device is changed.  When a time change happens all the channels will fault with a timeout.  I can sort of see why this is happening, after all the last message wasn't received in X minutes according to the system clock.  However I would have thought that the internals of WCF would be using actual elapsed time, not basing things on the system clock.  I can set the channel timeouts to some arbitrary high amount of time, but then if there really is a problem I won't get the timeout.  Any suggestions as to how to handle this cleanly?
    D.
    Thursday, February 11, 2010 9:11 AM

Answers

  • Hi darynk,

    It seems you're encountering timeout error due to the system date/time changing on your embeded device. It is possible that the WCF internal timeout detection may somewhat rely on the system date/time. In addition, someother features such as timestamp soap header(for message replay detection) will also rely on the system time/clock on server and client machine. For your case, will the embeded device frequently change the timeout? If possible, you can consider hook the system time changing event and restart the WCF service/client whenever such a time change occurs.

    Please remember to mark the replies as answers if they help and unmark them if they provide no help.
    Monday, February 15, 2010 2:39 AM
    Moderator

All replies

  • Hi darynk,

    It seems you're encountering timeout error due to the system date/time changing on your embeded device. It is possible that the WCF internal timeout detection may somewhat rely on the system date/time. In addition, someother features such as timestamp soap header(for message replay detection) will also rely on the system time/clock on server and client machine. For your case, will the embeded device frequently change the timeout? If possible, you can consider hook the system time changing event and restart the WCF service/client whenever such a time change occurs.

    Please remember to mark the replies as answers if they help and unmark them if they provide no help.
    Monday, February 15, 2010 2:39 AM
    Moderator
  • We are actually using net.namedpipe as our binding, so that should be using binary encoding, right?  This should mean that SOAP header shouldn't come into play here (please correct me if I am mistaken).  We have also had issues with the time changing event (there is something about app-domains not getting notified if a time change happens), so that isn't something we have been able to rely on.  Right now we are toying with the idea that when the time change happens reboot the device, however that isn't as elegant of a solution as we really need.
    D.
    Friday, February 19, 2010 1:51 AM