Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

InternetAddress implementation #3

Closed
pulyaevskiy opened this issue Oct 9, 2017 · 5 comments
Closed

InternetAddress implementation #3

pulyaevskiy opened this issue Oct 9, 2017 · 5 comments

Comments

@pulyaevskiy
Copy link
Owner

Work has started here:

Need to finalize, but there looks like no support for parsing IPs in to their in_addr format in Node. Might just throw UnsupportedError to start with.

@cedx
Copy link

cedx commented Feb 10, 2018

For my part, I ended up using the ipaddr.js package.
See: https://github.com/cedx/nodejs-interop.dart/blob/master/lib/src/io/socket/internet_address.dart

That's what a Node.js developer would have done (i.e. use a dedicated npm module). I did not have the courage to translate the JS code of the ipaddr.js package to Dart code...

Clearly not a satisfying solution but it works.

@pulyaevskiy
Copy link
Owner Author

Thanks for the feedback!

Looking now at my original comment I'm not sure why I needed in_addr actually. Just looked at the interface again and feel like there is no real blockers, but as you said just need to either port some logic from that npm package, or I also thought it would be worth looking in the Dart VM source code to make sure behavior is identical.

@pulyaevskiy
Copy link
Owner Author

Oh, I think I was looking for in_addr because native implementation uses inet_pton C function which is platform-dependent.

@pulyaevskiy
Copy link
Owner Author

FYI: I ended up implementing what inet_pton is doing, published as 1.0.0-dev.2.0.

@cedx
Copy link

cedx commented Feb 14, 2018

Wise decision to use a v1.0-dev tag because v0.1 tag did not give justice to your library that I find more advanced than mine :) great work !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants