Created
August 16, 2011 17:07
-
-
Save piscisaureus/1149564 to your computer and use it in GitHub Desktop.
This file contains 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
Dealing with stdio | |
1. figure out the type of stdio handle | |
2. use it | |
* Windows | |
+ console handle -> ReadConsoleInput / WriteConsoleOutput. Captures keystrokes. | |
+ (blocking) named pipe -> ReadFile / WriteFile in a thread. | |
+ (blocking) file handle -> ReadFile / WriteFile in a thread. | |
+ (overlapped) named pipe server handle -> Igor's patch | |
+ other options not considered so far: socket, tcp server, overlapped file, overlapped | |
* Unix | |
+ tty -> set to nonblocking, raw mode. Decode vt100, emit keystrokes. | |
+ file -> use libeio | |
+ pipe / socket -> set to nonblocking mode. Attach to uv_tcp / uv_pipe handle | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment