-
-
Notifications
You must be signed in to change notification settings - Fork 587
TCP: Allow connecting by hostname #2053
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
Conversation
1f36d94 to
67a0f66
Compare
JonasVautherin
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice! I fixed the style, and the other CI issues seem unrelated to this PR.
julianoes
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Any chance you can add the same for Windows while you're at it?
| remote_addr.sin_addr.s_addr = inet_addr(_remote_ip.c_str()); | ||
|
|
||
| struct hostent* hp; | ||
| hp = gethostbyname(_remote_ip.c_str()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| hp = gethostbyname(_remote_ip.c_str()); | |
| struct hostent* hp; = gethostbyname(_remote_ip.c_str()); |
As I read it, this doesn't need cleaning up, right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No appranently this points to static memory
|
I believe this should work for windows as well - does the windows CI test open a TCP connection? Otherwise I'd need to to test a real windows machine. |
|
CI likely doesn't test it. I'll try to test on Windows some time but you might beat me to it. |
|
@ThomasDebrunner sorry for the delay. Trying to build and run this on Windows caused some work 😄, see #2069. So, anyway, let me just merge it. |
This allows TCP connections to be made by hostname, not just IP - e.g.
tcp://localhost:1234, ortcp://my-device.local:1234Tested on linux and macos