-
Notifications
You must be signed in to change notification settings - Fork 187
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
Update libuv to 1.41.0 #534
Conversation
f0b5a29
to
75bb232
Compare
New function docs: (for some reason |
e.g. the uv_pipe function added in 1.41.0 being a substring of uv_pipe_getsockname, etc
Tests are ported from Libuv
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.
Good PR.
Them being at index 3 and 4 was left over from my initial misguided attempt at binding this function. Whoops!
Are you plan to do uv_socketpair? |
Yes, but I haven't decided how to bind it yet, since the
So maybe something like this? uv.socketpair([type], [protocol], [flags0], [flags1])
**Parameters:**
- `type`: `string` or `nil` (default: `stream`)
- `protocol`: `integer` or `nil` (default: 0)
- `flags0`: `table` or `nil`
- `nonblock`: `boolean` (default: `false`)
- `flags1`: `table` or `nil`
- `nonblock`: `boolean` (default: `false`) Let me know if you have any better ideas. |
Look https://man7.org/linux/man-pages/man2/socketpair.2.html, and https://man7.org/linux/man-pages/man2/socket.2.html, I prefer to reuse the code for Lines 118 to 148 in b3a7e09
for socket() we should keep open accpet wide value range, If not right, libuv will report error in runtime. |
I think we're actually binding the From
From
From my local
And from the output of
That is, luv is translating the returned protocol Line 52 in b3a7e09
but that is incorrect; it is actually the I'll try implementing how I think protocols should be handled when binding |
On Windows, socketpair creates TCP sockets that don't get detected as "pipe" from guess_handle
if (lua_type(L, 1) == LUA_TTABLE) { | ||
lua_getfield(L, 1, "nonblock"); | ||
if (lua_toboolean(L, -1)) read_flags |= UV_NONBLOCK_PIPE; | ||
lua_pop(L, 1); | ||
} else if (!lua_isnoneornil(L, 1)) { | ||
luv_arg_type_error(L, 1, "table or nil expected, got %s"); | ||
} |
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.
I think it's better to wrap it as a static function to reuse the code.
Nice work guys! Also I'm not surprised I got the protocol stuff wrong. I barely understood it at the time. |
No description provided.