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

Provide a method to get the system hostname #39

Open
buko opened this issue Jun 10, 2019 · 2 comments
Open

Provide a method to get the system hostname #39

buko opened this issue Jun 10, 2019 · 2 comments

Comments

@buko
Copy link

buko commented Jun 10, 2019

The native-platform project is really cool. Just discovered it today and really liking it! Thanks for it.

I would like to suggest that the native-platform project should provide a method for retrieving the system hostname. There's really no good and reliable way to do this using pure Java. But it's a very common requirement -- along with getting the current process PID -- for many applications.

There's another project https://github.com/mattsheppard/gethostname4j by @mattsheppard which already provides this functionality. It's MIT LICENSE. It may make sense to leverage that code or perhaps even merge that project this into this one.

Keep up the good work!

@mattsheppard
Copy link

Feel free to take it - it's 38 lines long :)

https://github.com/mattsheppard/gethostname4j/blob/master/src/main/java/com/kstruct/gethostname4j/Hostname.java

@adammurdoch
Copy link
Contributor

Thanks @mattsheppard, I will borrow this at some point.

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

3 participants