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

OSC: Don't do reverse name lookup when handling packets #450

Merged
merged 1 commit into from Feb 9, 2020

Conversation

perryprog
Copy link
Contributor

I ran into an issue when using a listener/handler with the osc-server. Turns out, due to my being on a non-internet connected network, INetAddress was trying to perform a reverse name lookup on the server that had sent me the OSC packet. This was then hanging until the timeout was reached.

Using #getHostString will not perform a lookup, and instead just use the hostname/ip the address was initialized with.

I realize that this isn't (technically) a backwards compatible change, so let me know if I should add a flag to choose between the types of behavior.

@hlolli
Copy link
Member

hlolli commented Feb 9, 2020

What's the error you're getting, looks like you have some disfunctional /etc/hosts, would

(or (.getHostName src) (.getHostString src))

work to solve your problem?

@perryprog
Copy link
Contributor Author

I wasn’t getting any error (although I’m not sure if something would come up with some logging). .getHostName is still returning the IP address as the fallback, so your proposed alternative would not work.

@hlolli
Copy link
Member

hlolli commented Feb 9, 2020

Ok, since Overtone is already pre Java7 incompatible for other resons, I don't see a reson not to merge this.

https://docs.oracle.com/javase/7/docs/api/java/net/InetSocketAddress.html#getHostString()

This is basically getting the hostname or falling back to a string of the hostname, as you mentioend.

Thanks for this! Keep 'em coming, was on ICLC so I wasn't available for reviewing until today :)

@hlolli hlolli merged commit 6ac5755 into overtone:master Feb 9, 2020
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

Successfully merging this pull request may close these issues.

None yet

2 participants