add uv_device_t as stream on windows and Linux to handle device I/O#19
Closed
zhaozg wants to merge 1 commit into
Closed
add uv_device_t as stream on windows and Linux to handle device I/O#19zhaozg wants to merge 1 commit into
zhaozg wants to merge 1 commit into
Conversation
Member
|
Thanks for reopening the PR @zhaozg I'll take a look as soon as I can. |
|
Really want this PR merged in to stop appalling performance on low CPU devices |
Contributor
|
What advantage does this have over just using uv_poll? |
Member
|
@Ralith uv_poll only works for sockes on Windows. Also, IIRC it wouldn't work on OSX either. |
Contributor
Author
|
rebase with master, please see #378 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
After long conversion on joyent/libuv#1580, I need make a RP here.
Libuv is a good i/o framework, and easy to extent, I hope persist on libuv to do my work.
When I want to do r/w device on windows, I try filesystem api, it works for device handle, but not fit my needs. I need a real stream, I try wrap handle as pipe, and fail to work. When I study TTY and TCP, I realize that it not hard to implication a device type stream, because just file operation with overlapped, even simpler than other stream types.
There are only two type related api.
uv_device_init will init and create a uv_deive_t, path should be '/dev/??' on linux or ".\Global???" on windows. flags should be O_RDONLY,O_WRONLY or O_RDWR.
uv_device_ioctl will set or get device paramater, arg is relative with OS platform, return >=0 for success, detail please see header file.
because not test widely, so maybe have bugs, please attention.
Happy for do something for libUV.