Giter Club home page Giter Club logo

Comments (4)

Yortw avatar Yortw commented on August 22, 2024

Hi,

That file is not actually used any more (should be deleted from the repo). The portable library is now just a bait library, and the platform specific libraries are used at runtime. Opening the solution in VS will show that file isn't loaded in the portable project. All of the actual NtpClient code that is being compiled into assemblies has an 'else' condition on those statements which raises the ErrorOcurred event.

For the actual implementation being used, see the files;
https://github.com/Yortw/Yort.Ntp/blob/master/src/Yort.Ntp.Shared.StandardSockets/NtpClientStandardSockets.cs

https://github.com/Yortw/Yort.Ntp/blob/master/src/Yort.Ntp.WinRT/NtpClientWinRTSockets.cs

If you're not seeing the ErrorOccured event raised under some condition, could you please advise the platform & conditions required to reproduce?

Thanks.

from yort.ntp.

Yortw avatar Yortw commented on August 22, 2024

For example, this code should fail as the host cannot be resolved, and the ErrorOcurred event should be raised which will then write the exception details to the debug window. I tested this in a desktop console app.

		static void Main(string[] args)
		{
			Yort.Ntp.NtpClient c = new Yort.Ntp.NtpClient("notanntpserver");
			c.ErrorOccurred += client_ErrorOccurred;
			c.BeginRequestTime();
		}

		private static void client_ErrorOccurred(object sender, Yort.Ntp.NtpNetworkErrorEventArgs e)
		{
			System.Diagnostics.Debug.WriteLine(e.Exception.ToString());
		}

from yort.ntp.

codingyourlife avatar codingyourlife commented on August 22, 2024

I didn't test it yet but when I looked at the wrong file and it is implemented in the NuGet package that I get this is closed for me. Thanks!

from yort.ntp.

Yortw avatar Yortw commented on August 22, 2024

No problem, that file should have been removed earlier but somehow I missed it when implementing that change.

Thanks for reporting the potential issue.

from yort.ntp.

Related Issues (14)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.