{"action":"created","comment":{"url":"https://api.github.com/repos/alexhultman/uWebSockets/pulls/comments/59138140","id":59138140,"diff_hunk":"@@ -18,10 +18,16 @@ using namespace std;\n \n #ifdef _WIN32\n #if _MSC_VER >= 1900\n-#include <io.h>\n-#if !defined(dup)\n-#define dup _dup\n-#endif\n+#include <cassert>\n+inline FD dup(FD socket)\n+{\n+ WSAPROTOCOL_INFO pi;\n+ auto rv = WSADuplicateSocket(socket, ::GetCurrentProcessId(), &pi); \n+ assert(rv == 0);\n+ auto socketDuped = WSASocket(AF_INET, SOCK_STREAM, IPPROTO_TCP, &pi, 0, WSA_FLAG_OVERLAPPED); \n+ assert(socketDuped > 0);\n+ return socketDuped;  \n+}","path":"src/uWS.cpp","position":14,"original_position":17,"commit_id":"9a2bf3545e8de34b24b8a8ba08a6eca29c35f4c2","original_commit_id":"9a2bf3545e8de34b24b8a8ba08a6eca29c35f4c2","user":{"login":"alexhultman","id":3397140,"avatar_url":"https://avatars.githubusercontent.com/u/3397140?v=3","gravatar_id":"","url":"https://api.github.com/users/alexhultman","html_url":"https://github.com/alexhultman","followers_url":"https://api.github.com/users/alexhultman/followers","following_url":"https://api.github.com/users/alexhultman/following{/other_user}","gists_url":"https://api.github.com/users/alexhultman/gists{/gist_id}","starred_url":"https://api.github.com/users/alexhultman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alexhultman/subscriptions","organizations_url":"https://api.github.com/users/alexhultman/orgs","repos_url":"https://api.github.com/users/alexhultman/repos","events_url":"https://api.github.com/users/alexhultman/events{/privacy}","received_events_url":"https://api.github.com/users/alexhultman/received_events","type":"User","site_admin":false},"body":"This is a very nice addition, I'll take a look at this tomorrow. I'm super tired today.","created_at":"2016-04-10T18:00:28Z","updated_at":"2016-04-10T18:00:28Z","html_url":"https://github.com/alexhultman/uWebSockets/pull/42#discussion_r59138140","pull_request_url":"https://api.github.com/repos/alexhultman/uWebSockets/pulls/42","_links":{"self":{"href":"https://api.github.com/repos/alexhultman/uWebSockets/pulls/comments/59138140"},"html":{"href":"https://github.com/alexhultman/uWebSockets/pull/42#discussion_r59138140"},"pull_request":{"href":"https://api.github.com/repos/alexhultman/uWebSockets/pulls/42"}}},"pull_request":{"url":"https://api.github.com/repos/alexhultman/uWebSockets/pulls/42","id":65906306,"html_url":"https://github.com/alexhultman/uWebSockets/pull/42","diff_url":"https://github.com/alexhultman/uWebSockets/pull/42.diff","patch_url":"https://github.com/alexhultman/uWebSockets/pull/42.patch","issue_url":"https://api.github.com/repos/alexhultman/uWebSockets/issues/42","number":42,"state":"open","locked":false,"title":"Windows fixes","user":{"login":"peters","id":869,"avatar_url":"https://avatars.githubusercontent.com/u/869?v=3","gravatar_id":"","url":"https://api.github.com/users/peters","html_url":"https://github.com/peters","followers_url":"https://api.github.com/users/peters/followers","following_url":"https://api.github.com/users/peters/following{/other_user}","gists_url":"https://api.github.com/users/peters/gists{/gist_id}","starred_url":"https://api.github.com/users/peters/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/peters/subscriptions","organizations_url":"https://api.github.com/users/peters/orgs","repos_url":"https://api.github.com/users/peters/repos","events_url":"https://api.github.com/users/peters/events{/privacy}","received_events_url":"https://api.github.com/users/peters/received_events","type":"User","site_admin":false},"body":"/cc @alexhultman \r\n\r\nLet me know if there is anything you want to change, I'm available on github the next 8 hours :+1: ","created_at":"2016-04-10T10:01:46Z","updated_at":"2016-04-10T18:00:28Z","closed_at":null,"merged_at":null,"merge_commit_sha":"986bf12575677fab0f53e5cbab90baed86226d63","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/alexhultman/uWebSockets/pulls/42/commits","review_comments_url":"https://api.github.com/repos/alexhultman/uWebSockets/pulls/42/comments","review_comment_url":"https://api.github.com/repos/alexhultman/uWebSockets/pulls/comments{/number}","comments_url":"https://api.github.com/repos/alexhultman/uWebSockets/issues/42/comments","statuses_url":"https://api.github.com/repos/alexhultman/uWebSockets/statuses/9a2bf3545e8de34b24b8a8ba08a6eca29c35f4c2","head":{"label":"peters:master","ref":"master","sha":"9a2bf3545e8de34b24b8a8ba08a6eca29c35f4c2","user":{"login":"peters","id":869,"avatar_url":"https://avatars.githubusercontent.com/u/869?v=3","gravatar_id":"","url":"https://api.github.com/users/peters","html_url":"https://github.com/peters","followers_url":"https://api.github.com/users/peters/followers","following_url":"https://api.github.com/users/peters/following{/other_user}","gists_url":"https://api.github.com/users/peters/gists{/gist_id}","starred_url":"https://api.github.com/users/peters/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/peters/subscriptions","organizations_url":"https://api.github.com/users/peters/orgs","repos_url":"https://api.github.com/users/peters/repos","events_url":"https://api.github.com/users/peters/events{/privacy}","received_events_url":"https://api.github.com/users/peters/received_events","type":"User","site_admin":false},"repo":{"id":55891751,"name":"uWebSockets","full_name":"peters/uWebSockets","owner":{"login":"peters","id":869,"avatar_url":"https://avatars.githubusercontent.com/u/869?v=3","gravatar_id":"","url":"https://api.github.com/users/peters","html_url":"https://github.com/peters","followers_url":"https://api.github.com/users/peters/followers","following_url":"https://api.github.com/users/peters/following{/other_user}","gists_url":"https://api.github.com/users/peters/gists{/gist_id}","starred_url":"https://api.github.com/users/peters/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/peters/subscriptions","organizations_url":"https://api.github.com/users/peters/orgs","repos_url":"https://api.github.com/users/peters/repos","events_url":"https://api.github.com/users/peters/events{/privacy}","received_events_url":"https://api.github.com/users/peters/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/peters/uWebSockets","description":"Highly scalable WebSocket server library","fork":true,"url":"https://api.github.com/repos/peters/uWebSockets","forks_url":"https://api.github.com/repos/peters/uWebSockets/forks","keys_url":"https://api.github.com/repos/peters/uWebSockets/keys{/key_id}","collaborators_url":"https://api.github.com/repos/peters/uWebSockets/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/peters/uWebSockets/teams","hooks_url":"https://api.github.com/repos/peters/uWebSockets/hooks","issue_events_url":"https://api.github.com/repos/peters/uWebSockets/issues/events{/number}","events_url":"https://api.github.com/repos/peters/uWebSockets/events","assignees_url":"https://api.github.com/repos/peters/uWebSockets/assignees{/user}","branches_url":"https://api.github.com/repos/peters/uWebSockets/branches{/branch}","tags_url":"https://api.github.com/repos/peters/uWebSockets/tags","blobs_url":"https://api.github.com/repos/peters/uWebSockets/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/peters/uWebSockets/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/peters/uWebSockets/git/refs{/sha}","trees_url":"https://api.github.com/repos/peters/uWebSockets/git/trees{/sha}","statuses_url":"https://api.github.com/repos/peters/uWebSockets/statuses/{sha}","languages_url":"https://api.github.com/repos/peters/uWebSockets/languages","stargazers_url":"https://api.github.com/repos/peters/uWebSockets/stargazers","contributors_url":"https://api.github.com/repos/peters/uWebSockets/contributors","subscribers_url":"https://api.github.com/repos/peters/uWebSockets/subscribers","subscription_url":"https://api.github.com/repos/peters/uWebSockets/subscription","commits_url":"https://api.github.com/repos/peters/uWebSockets/commits{/sha}","git_commits_url":"https://api.github.com/repos/peters/uWebSockets/git/commits{/sha}","comments_url":"https://api.github.com/repos/peters/uWebSockets/comments{/number}","issue_comment_url":"https://api.github.com/repos/peters/uWebSockets/issues/comments{/number}","contents_url":"https://api.github.com/repos/peters/uWebSockets/contents/{+path}","compare_url":"https://api.github.com/repos/peters/uWebSockets/compare/{base}...{head}","merges_url":"https://api.github.com/repos/peters/uWebSockets/merges","archive_url":"https://api.github.com/repos/peters/uWebSockets/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/peters/uWebSockets/downloads","issues_url":"https://api.github.com/repos/peters/uWebSockets/issues{/number}","pulls_url":"https://api.github.com/repos/peters/uWebSockets/pulls{/number}","milestones_url":"https://api.github.com/repos/peters/uWebSockets/milestones{/number}","notifications_url":"https://api.github.com/repos/peters/uWebSockets/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/peters/uWebSockets/labels{/name}","releases_url":"https://api.github.com/repos/peters/uWebSockets/releases{/id}","deployments_url":"https://api.github.com/repos/peters/uWebSockets/deployments","created_at":"2016-04-10T09:55:09Z","updated_at":"2016-04-10T09:55:10Z","pushed_at":"2016-04-10T17:50:37Z","git_url":"git://github.com/peters/uWebSockets.git","ssh_url":"git@github.com:peters/uWebSockets.git","clone_url":"https://github.com/peters/uWebSockets.git","svn_url":"https://github.com/peters/uWebSockets","homepage":"","size":173,"stargazers_count":0,"watchers_count":0,"language":"C++","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"alexhultman:master","ref":"master","sha":"be881cee50262d73a4d89d28c4754264edc0a19b","user":{"login":"alexhultman","id":3397140,"avatar_url":"https://avatars.githubusercontent.com/u/3397140?v=3","gravatar_id":"","url":"https://api.github.com/users/alexhultman","html_url":"https://github.com/alexhultman","followers_url":"https://api.github.com/users/alexhultman/followers","following_url":"https://api.github.com/users/alexhultman/following{/other_user}","gists_url":"https://api.github.com/users/alexhultman/gists{/gist_id}","starred_url":"https://api.github.com/users/alexhultman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alexhultman/subscriptions","organizations_url":"https://api.github.com/users/alexhultman/orgs","repos_url":"https://api.github.com/users/alexhultman/repos","events_url":"https://api.github.com/users/alexhultman/events{/privacy}","received_events_url":"https://api.github.com/users/alexhultman/received_events","type":"User","site_admin":false},"repo":{"id":54360307,"name":"uWebSockets","full_name":"alexhultman/uWebSockets","owner":{"login":"alexhultman","id":3397140,"avatar_url":"https://avatars.githubusercontent.com/u/3397140?v=3","gravatar_id":"","url":"https://api.github.com/users/alexhultman","html_url":"https://github.com/alexhultman","followers_url":"https://api.github.com/users/alexhultman/followers","following_url":"https://api.github.com/users/alexhultman/following{/other_user}","gists_url":"https://api.github.com/users/alexhultman/gists{/gist_id}","starred_url":"https://api.github.com/users/alexhultman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alexhultman/subscriptions","organizations_url":"https://api.github.com/users/alexhultman/orgs","repos_url":"https://api.github.com/users/alexhultman/repos","events_url":"https://api.github.com/users/alexhultman/events{/privacy}","received_events_url":"https://api.github.com/users/alexhultman/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/alexhultman/uWebSockets","description":"Highly scalable WebSocket server library","fork":false,"url":"https://api.github.com/repos/alexhultman/uWebSockets","forks_url":"https://api.github.com/repos/alexhultman/uWebSockets/forks","keys_url":"https://api.github.com/repos/alexhultman/uWebSockets/keys{/key_id}","collaborators_url":"https://api.github.com/repos/alexhultman/uWebSockets/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/alexhultman/uWebSockets/teams","hooks_url":"https://api.github.com/repos/alexhultman/uWebSockets/hooks","issue_events_url":"https://api.github.com/repos/alexhultman/uWebSockets/issues/events{/number}","events_url":"https://api.github.com/repos/alexhultman/uWebSockets/events","assignees_url":"https://api.github.com/repos/alexhultman/uWebSockets/assignees{/user}","branches_url":"https://api.github.com/repos/alexhultman/uWebSockets/branches{/branch}","tags_url":"https://api.github.com/repos/alexhultman/uWebSockets/tags","blobs_url":"https://api.github.com/repos/alexhultman/uWebSockets/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/alexhultman/uWebSockets/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/alexhultman/uWebSockets/git/refs{/sha}","trees_url":"https://api.github.com/repos/alexhultman/uWebSockets/git/trees{/sha}","statuses_url":"https://api.github.com/repos/alexhultman/uWebSockets/statuses/{sha}","languages_url":"https://api.github.com/repos/alexhultman/uWebSockets/languages","stargazers_url":"https://api.github.com/repos/alexhultman/uWebSockets/stargazers","contributors_url":"https://api.github.com/repos/alexhultman/uWebSockets/contributors","subscribers_url":"https://api.github.com/repos/alexhultman/uWebSockets/subscribers","subscription_url":"https://api.github.com/repos/alexhultman/uWebSockets/subscription","commits_url":"https://api.github.com/repos/alexhultman/uWebSockets/commits{/sha}","git_commits_url":"https://api.github.com/repos/alexhultman/uWebSockets/git/commits{/sha}","comments_url":"https://api.github.com/repos/alexhultman/uWebSockets/comments{/number}","issue_comment_url":"https://api.github.com/repos/alexhultman/uWebSockets/issues/comments{/number}","contents_url":"https://api.github.com/repos/alexhultman/uWebSockets/contents/{+path}","compare_url":"https://api.github.com/repos/alexhultman/uWebSockets/compare/{base}...{head}","merges_url":"https://api.github.com/repos/alexhultman/uWebSockets/merges","archive_url":"https://api.github.com/repos/alexhultman/uWebSockets/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/alexhultman/uWebSockets/downloads","issues_url":"https://api.github.com/repos/alexhultman/uWebSockets/issues{/number}","pulls_url":"https://api.github.com/repos/alexhultman/uWebSockets/pulls{/number}","milestones_url":"https://api.github.com/repos/alexhultman/uWebSockets/milestones{/number}","notifications_url":"https://api.github.com/repos/alexhultman/uWebSockets/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/alexhultman/uWebSockets/labels{/name}","releases_url":"https://api.github.com/repos/alexhultman/uWebSockets/releases{/id}","deployments_url":"https://api.github.com/repos/alexhultman/uWebSockets/deployments","created_at":"2016-03-21T04:39:40Z","updated_at":"2016-04-10T17:58:19Z","pushed_at":"2016-04-10T17:50:37Z","git_url":"git://github.com/alexhultman/uWebSockets.git","ssh_url":"git@github.com:alexhultman/uWebSockets.git","clone_url":"https://github.com/alexhultman/uWebSockets.git","svn_url":"https://github.com/alexhultman/uWebSockets","homepage":"","size":175,"stargazers_count":276,"watchers_count":276,"language":"C++","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":14,"mirror_url":null,"open_issues_count":7,"forks":14,"open_issues":7,"watchers":276,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/alexhultman/uWebSockets/pulls/42"},"html":{"href":"https://github.com/alexhultman/uWebSockets/pull/42"},"issue":{"href":"https://api.github.com/repos/alexhultman/uWebSockets/issues/42"},"comments":{"href":"https://api.github.com/repos/alexhultman/uWebSockets/issues/42/comments"},"review_comments":{"href":"https://api.github.com/repos/alexhultman/uWebSockets/pulls/42/comments"},"review_comment":{"href":"https://api.github.com/repos/alexhultman/uWebSockets/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/alexhultman/uWebSockets/pulls/42/commits"},"statuses":{"href":"https://api.github.com/repos/alexhultman/uWebSockets/statuses/9a2bf3545e8de34b24b8a8ba08a6eca29c35f4c2"}}}}