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

getaddrinfo, getnameinfo #23596

Merged
merged 2 commits into from
Sep 19, 2017
Merged

getaddrinfo, getnameinfo #23596

merged 2 commits into from
Sep 19, 2017

Conversation

vtjnash
Copy link
Sponsor Member

@vtjnash vtjnash commented Sep 5, 2017

Improves API coverage of basic socket infrastructure.

@vtjnash vtjnash added the domain:io Involving the I/O subsystem: libuv, read, write, etc. label Sep 5, 2017
req = Libc.malloc(_sizeof_uv_getaddrinfo)
uv_req_set_data(req, C_NULL) # in case we get interrupted before arriving at the wait call
status = ccall(:jl_getaddrinfo, Int32, (Ptr{Void}, Ptr{Void}, Cstring, Ptr{Void}, Ptr{Void}),
eventloop(), req, host, #=service=#C_NULL, uv_jl_getaddrinfocb::Ptr{Void})
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably meant to take out #=service=#

Copy link
Sponsor Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, I like doing comments of his form

if status < 0
Libc.free(req)
if status == UV_EINVAL
throw(ArgumentError("Invalid getaddrinfo argument"))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

probably should update all these error messages to reference getalladdrinfo instead of getaddrinfo (though I'm not a huge fan of the getalladdrinfo name).

Copy link
Sponsor Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The error itself still comes from getaddrinfo

@StefanKarpinski
Copy link
Sponsor Member

I approve of the deprecation part.

@vtjnash vtjnash force-pushed the jn/21555 branch 2 times, most recently from 1915931 to 45dd908 Compare September 7, 2017 15:26
@vtjnash
Copy link
Sponsor Member Author

vtjnash commented Sep 7, 2017

Looks like CI hit a lot of known bad tests, but is otherwise passing

expose more system functionality, add getalladdrinfo to get a list of all address (rather than just the first)
avoid making callbacks from inside the libuv event loop

fix #21555
This function is the complement of getaddinfo.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
domain:io Involving the I/O subsystem: libuv, read, write, etc.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants