Comments (6)
Same behavior (same exception type/message in ErrorOccurred
event) when using the non-async calls
var client = new NtpClient(KnownNtpServers.NorthAmericaOrg);
client.TimeReceived += Client_TimeReceived;
client.ErrorOccurred += Client_ErrorOccurred;
client.BeginRequestTime();
from yort.ntp.
Sorry for the delayed reply, I have been away and was not in a position to do development or check GitHub.
I'm also sorry this isn't working for you. It appears to just be broken. I swear I tested it on Android before publishing, but it doesn't work now and it doesn't look like it ever did so I don't know what happened.
The basic problem is that Xamarin Android purports to support all the same socket API's as the desktop framework/iOS etc. but at least one of them throws a NotImplementedException and doesn't really work. Specifically calling System.Net.Sockets.Socket.Connect and passing a DnsEndPoint instance throws an exception from the EndPoint base class used by DnsEndPoint. I haven't found any way around this. I'm not sure what the point of DnsEndPoint is in Xamarin Android if you can't pass it to a socket.
However, I have found the same code works with an IpEndPoint, so it may be possible to do a manual DNS resolution of the server name to IP, then pass the IP to the socket. However I haven't had time yet to confirm this, and because it's (probably) (marginally) less efficient I'd prefer to only do it on Android, so it will need either a new implementation or some conditional compilation logic in the shared code file.
I'll let you know if/when I've managed to find a solution.
Thanks for reporting the problem.
from yort.ntp.
Thank you for your response.
Let me know if I can help test a potential solution.
from yort.ntp.
Hi,
I've published a beta package (https://www.nuget.org/packages/Yort.Ntp.Portable/1.0.10-beta) to Nuget . Make sure you turn on the 'pre-release' option in VS to see the new version.
I've tested it on a Samsung Galaxy S5 on Android 6.0.1 and it seems to work.
Please try that package and let me know if it works for you.
Thanks.
from yort.ntp.
The new version works. Thanks for the quick fix!
from yort.ntp.
No problem. Thanks for reporting it.
from yort.ntp.
Related Issues (14)
- Something not right with nuget package? HOT 9
- Provide the lib as a .net standard library HOT 1
- Problem with Raspberry Pi HOT 1
- System.Net.EndPoint.Serialize throws System.NotImplementedException on Mono Linux HOT 1
- Nuget package is unsigned HOT 1
- Maui support
- Client_ErrorOccurred not being triggered properly
- Specific assembly exception HOT 21
- Get a problem trying to build .net core HOT 4
- Socket unsubscription to OnMessageReceived throws Exception "A method was called at an unexpected time." HOT 3
- NTP SocketError.Error else block and event HOT 4
- Time issue HOT 2
- Android and iOS errors HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from yort.ntp.