Skip to content

SntpClient failure notification #12

Description

@trailway

The SntpClient class is notifying failures multiple times. This can be reproduced by pulling the network cable from machine. I added the following check to avoid this:

    public void BeginGetDate(Action<DateTime> getTime, Action failure)
    {
        _index += 1;
        if (_hosts.Length <= _index)
        {
            if (_hosts.Length == _index)
            {
                failure();
            }
            return;
        }

I suspect that there may be a deeper problem here but the fix isn't obvious to me.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions