{"action":"closed","issue":{"url":"https://api.github.com/repos/uWebSockets/uWebSockets/issues/517","repository_url":"https://api.github.com/repos/uWebSockets/uWebSockets","labels_url":"https://api.github.com/repos/uWebSockets/uWebSockets/issues/517/labels{/name}","comments_url":"https://api.github.com/repos/uWebSockets/uWebSockets/issues/517/comments","events_url":"https://api.github.com/repos/uWebSockets/uWebSockets/issues/517/events","html_url":"https://github.com/uWebSockets/uWebSockets/issues/517","id":212499031,"number":517,"title":"Sockets block using large data - C++ & Windows","user":{"login":"GGRI","id":25770794,"avatar_url":"https://avatars0.githubusercontent.com/u/25770794?v=3","gravatar_id":"","url":"https://api.github.com/users/GGRI","html_url":"https://github.com/GGRI","followers_url":"https://api.github.com/users/GGRI/followers","following_url":"https://api.github.com/users/GGRI/following{/other_user}","gists_url":"https://api.github.com/users/GGRI/gists{/gist_id}","starred_url":"https://api.github.com/users/GGRI/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/GGRI/subscriptions","organizations_url":"https://api.github.com/users/GGRI/orgs","repos_url":"https://api.github.com/users/GGRI/repos","events_url":"https://api.github.com/users/GGRI/events{/privacy}","received_events_url":"https://api.github.com/users/GGRI/received_events","type":"User","site_admin":false},"labels":[{"id":462685664,"url":"https://api.github.com/repos/uWebSockets/uWebSockets/labels/unconfirmed%20bug","name":"unconfirmed bug","color":"0e8a16","default":false},{"id":364725715,"url":"https://api.github.com/repos/uWebSockets/uWebSockets/labels/Windows","name":"Windows","color":"0e8a16","default":false}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":8,"created_at":"2017-03-07T17:14:01Z","updated_at":"2017-03-25T08:21:27Z","closed_at":"2017-03-25T08:21:27Z","body":"Hi,\r\n\r\nUsing uWS (0.13.0 or the latest master branch) as a C++ websocket server on Windows 7, I have an issue using large data, especially using SSL. I reproduce this every time with 2 clients: after less than 2 minutes, one or more sockets are blocked and can't send data anymore while they continue to receive. \r\n\r\nAfter digging into uWS code, libuv, openSSL, stackoverflow & co I found the solution: Windows send & receive buffer size.\r\nThey could be configured in the registry on:  **HKLM/SYSTEM/CurrentControlSet/services/AFD/Parameters** using 2 DWORD entries:\r\n- DefaultReceiveWindow\r\n- DefaultSendWindow \r\nThe value is the result of: bandwith_in_kBps / 8 * 1024. It seems the default value is: 8192.\r\n\r\nSince it's not the best way to use the Windows registry, this can be done using C++ code:\r\n```\r\nint bufSize = 128000;\r\nint ret = setsockopt(ws.getFd(), SOL_SOCKET, SO_SNDBUF, &bufSize, sizeof(int));\r\nret = setsockopt(ws.getFd(), SOL_SOCKET, SO_RCVBUF, &bufSize, sizeof(int));\r\n```\r\nOf course I don't reproduce the issue using a properly configured buffer size with the above code.\r\n\r\nMy problem is **ws.getFd()** isn't natively possible because WebSocket derivates from a protected uS::Socket.\r\n\r\nMy request is simple: Can you add some code to allow developpers to configure those buffers or a simple way to access ws.getFd()?\r\n\r\nGuillaume"}}
{"actor":{"display_login":"alexhultman"}}