{"id":130,"date":"2006-12-02T14:04:56","date_gmt":"2006-12-02T12:04:56","guid":{"rendered":"https:\/\/alax.info\/blog\/130"},"modified":"2006-12-02T14:10:36","modified_gmt":"2006-12-02T12:10:36","slug":"windows-sockets-fun","status":"publish","type":"post","link":"https:\/\/alax.info\/blog\/130","title":{"rendered":"Windows Sockets fun"},"content":{"rendered":"<p>Simple stress application brings down <a href=\"http:\/\/msdn.microsoft.com\/library\/default.asp?url=\/library\/en-us\/winsock\/winsock\/windows_sockets_start_page_2.asp\">Windows Sockets subsystem<\/a> within tens of seconds on <a href=\"http:\/\/microsoft.com\">Microsoft<\/a> <a href=\"http:\/\/www.microsoft.com\/windowsxp\/pro\/default.mspx\">Windows XP Professional<\/a> Service Pack 2&#8230; It appears to be a key point that <span style=\"font-style: italic\">SO_RCVBUF<\/span> and <span style=\"font-style: italic\">SO_SNDBUF<\/span> <a href=\"http:\/\/msdn.microsoft.com\/library\/default.asp?url=\/library\/en-us\/winsock\/winsock\/setsockopt_2.asp\">sockets options<\/a> are increased from default value.<\/p>\n<p>The expected behavior, and it is the case with default socket buffer sizes, is running out of available anonymous sockets (ports 1024-5000 are engaged by active sockets or those on wait list to be freed, see <a href=\"http:\/\/support.microsoft.com\/kb\/149532\">&#8220;Windows NT Clients Run Out of Ports&#8221;<\/a> for details). Expected failure code is <a href=\"http:\/\/msdn.microsoft.com\/library\/default.asp?url=\/library\/en-us\/winsock\/winsock\/windows_sockets_error_codes_2.asp\"><em>10048 (WSAEADDRINUSE) &#8220;Address already in use&#8221;<\/em><\/a> on client.<\/p>\n<p>Instead, at some critical moment client side sockets start failing with <a href=\"http:\/\/msdn.microsoft.com\/library\/default.asp?url=\/library\/en-us\/winsock\/winsock\/windows_sockets_error_codes_2.asp\"><em>10054 (WSAECONNRESET) &#8220;Connection reset by peer&#8221;<\/em><\/a> error and server side sockets massively fail with <a href=\"http:\/\/msdn.microsoft.com\/library\/default.asp?url=\/library\/en-us\/winsock\/winsock\/windows_sockets_error_codes_2.asp\"><em>10093 (WSANOTINITIALISED) &#8220;Successful WSAStartup not yet performed&#8221;<\/em><\/a> code including, as it seems, a number of sockets already closed on client side and expected to get closed on server. After server connection sockets report failure, the listening socket reports <span style=\"font-style: italic\">ERROR_OUT_OF_MEMORY<\/span> error.<\/p>\n<p>Download <a href=\"https:\/\/alax.info\/blog\/wp-content\/uploads\/2006\/12\/tcpstress0101.zip\">Visual Studio .NET 2003 source code and compiled binaries<\/a>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Simple stress application brings down Windows Sockets subsystem within tens of seconds on Microsoft Windows XP Professional Service Pack 2&#8230; It appears to be a key point that SO_RCVBUF and SO_SNDBUF sockets options are increased from default value. The expected behavior, and it is the case with default socket buffer sizes, is running out of&hellip; <\/p>\n<p><a class=\"moretag\" href=\"https:\/\/alax.info\/blog\/130\">Read the full article<\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[21,13,12],"tags":[],"class_list":["post-130","post","type-post","status-publish","format-standard","hentry","category-seriously","category-source","category-technology"],"_links":{"self":[{"href":"https:\/\/alax.info\/blog\/wp-json\/wp\/v2\/posts\/130","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/alax.info\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/alax.info\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/alax.info\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/alax.info\/blog\/wp-json\/wp\/v2\/comments?post=130"}],"version-history":[{"count":0,"href":"https:\/\/alax.info\/blog\/wp-json\/wp\/v2\/posts\/130\/revisions"}],"wp:attachment":[{"href":"https:\/\/alax.info\/blog\/wp-json\/wp\/v2\/media?parent=130"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/alax.info\/blog\/wp-json\/wp\/v2\/categories?post=130"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/alax.info\/blog\/wp-json\/wp\/v2\/tags?post=130"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}