{"action":"created","issue":{"url":"https://api.github.com/repos/vim-jp/issues/issues/824","repository_url":"https://api.github.com/repos/vim-jp/issues","labels_url":"https://api.github.com/repos/vim-jp/issues/issues/824/labels{/name}","comments_url":"https://api.github.com/repos/vim-jp/issues/issues/824/comments","events_url":"https://api.github.com/repos/vim-jp/issues/issues/824/events","html_url":"https://github.com/vim-jp/issues/issues/824","id":133630515,"number":824,"title":"job_getchannel が Windows で動かない","user":{"login":"mattn","id":10111,"avatar_url":"https://avatars.githubusercontent.com/u/10111?v=3","gravatar_id":"","url":"https://api.github.com/users/mattn","html_url":"https://github.com/mattn","followers_url":"https://api.github.com/users/mattn/followers","following_url":"https://api.github.com/users/mattn/following{/other_user}","gists_url":"https://api.github.com/users/mattn/gists{/gist_id}","starred_url":"https://api.github.com/users/mattn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mattn/subscriptions","organizations_url":"https://api.github.com/users/mattn/orgs","repos_url":"https://api.github.com/users/mattn/repos","events_url":"https://api.github.com/users/mattn/events{/privacy}","received_events_url":"https://api.github.com/users/mattn/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":38,"created_at":"2016-02-15T06:07:39Z","updated_at":"2016-02-15T09:32:47Z","closed_at":null,"body":"https://gist.github.com/mattn/7669319349f19a1773b6\r\n\r\n```vim\r\nlet job = job_start(\"tee\")\r\nlet handle = job_getchannel(job)\r\necho ch_sendraw(handle, \"echo something\\n\")\r\ncall ch_close(handle)\r\ncall job_stop(job)\r\n```\r\n\r\nこのスクリプトで `echo something` が戻ってくる事は確認しました。\r\n"},"comment":{"url":"https://api.github.com/repos/vim-jp/issues/issues/comments/184131240","html_url":"https://github.com/vim-jp/issues/issues/824#issuecomment-184131240","issue_url":"https://api.github.com/repos/vim-jp/issues/issues/824","id":184131240,"user":{"login":"mattn","id":10111,"avatar_url":"https://avatars.githubusercontent.com/u/10111?v=3","gravatar_id":"","url":"https://api.github.com/users/mattn","html_url":"https://github.com/mattn","followers_url":"https://api.github.com/users/mattn/followers","following_url":"https://api.github.com/users/mattn/following{/other_user}","gists_url":"https://api.github.com/users/mattn/gists{/gist_id}","starred_url":"https://api.github.com/users/mattn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mattn/subscriptions","organizations_url":"https://api.github.com/users/mattn/orgs","repos_url":"https://api.github.com/users/mattn/repos","events_url":"https://api.github.com/users/mattn/events{/privacy}","received_events_url":"https://api.github.com/users/mattn/received_events","type":"User","site_admin":false},"created_at":"2016-02-15T09:32:47Z","updated_at":"2016-02-15T09:32:47Z","body":"@ynkdir これでどうでしょうか？\r\n\r\n```c\r\n    int\r\nfd_read(sock_T fd, char_u *buf, size_t len, int timeout)\r\n{\r\n    DWORD nread = (DWORD) -1;\r\n    OVERLAPPED ol;\r\n    ZeroMemory(&ol, sizeof(ol));\r\n    ol.hEvent = CreateEvent(0, 0, 0, 0);\r\n    if (!ReadFile(fd, buf, len, &nread, &ol))\r\n    {\r\n\tif (GetLastError() == ERROR_IO_PENDING)\r\n\t{\r\n\t    if (WaitForSingleObject(ol.hEvent, timeout) == WAIT_OBJECT_0)\r\n\t\tGetOverlappedResult(buf, &ol, &nread, FALSE);\r\n\t    else\r\n\t\tCancelIO(fd);\r\n\t}\r\n    }\r\n    CloseHandle(ol.hEvent);\r\n    return (int) nread;\r\n}\r\n```\r\n"}}