{"id":2280,"date":"2025-01-03T17:22:19","date_gmt":"2025-01-03T09:22:19","guid":{"rendered":"https:\/\/guapicoding.com\/?p=2280"},"modified":"2025-03-11T11:10:37","modified_gmt":"2025-03-11T03:10:37","slug":"%e8%b4%bc%e8%b4%bc%e8%b4%bc%e7%ae%80%e5%8d%95%e7%9a%84%e5%a4%9a%e4%ba%ba%e8%81%8a%e5%a4%a9%e5%ae%a4","status":"publish","type":"post","link":"https:\/\/guapicoding.com\/?p=2280","title":{"rendered":"\u8d3c\u8d3c\u8d3c\u7b80\u5355\u7684\u591a\u4eba\u804a\u5929\u5ba4"},"content":{"rendered":"\n<h2 class=\"wp-block-heading\">Linux Server<\/h2>\n\n\n\n<p>epoll\u5b9e\u73b0\u591a\u8def\u590d\u7528<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Windows Client<\/h2>\n\n\n\n<h4 class=\"wp-block-heading\">\u521d\u59cb\u5316Windows\u4e0b\u7684socket\u73af\u5883<\/h4>\n\n\n\n<pre class=\"wp-block-code\"><code>#pragma comment(lib, \"Ws2_32.lib\") \n\nint main() {\n    WORD wVersionRequested;\n    WSADATA wsaData;\n    int err;\n \n    wVersionRequested = MAKEWORD( 2, 2 );\n \n    err = WSAStartup( wVersionRequested, &amp;wsaData );\n    if ( err != 0 ) {\n        \/* Tell the user that we could not find a usable *\/\n        \/* WinSock DLL.                                  *\/\n        return -1;\n    }\n \n    \/* Confirm that the WinSock DLL supports 2.2.*\/\n    \/* Note that if the DLL supports versions greater    *\/\n    \/* than 2.2 in addition to 2.2, it will still return *\/\n    \/* 2.2 in wVersion since that is the version we      *\/\n    \/* requested.                                        *\/\n \n    if ( LOBYTE( wsaData.wVersion ) != 2 ||\n            HIBYTE( wsaData.wVersion ) != 2 ) {\n        \/* Tell the user that we could not find a usable *\/\n        \/* WinSock DLL.                                  *\/\n        WSACleanup( );\n        return -1; \n    }\n \n    \/* The WinSock DLL is acceptable. Proceed. *\/\n}<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Linux Server epoll\u5b9e\u73b0\u591a\u8def\u590d\u7528 Windows Client \u521d\u59cb\u5316Windows\u4e0b\u7684soc [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[69],"tags":[27,56,21,51],"class_list":["post-2280","post","type-post","status-publish","format-standard","hentry","category-project","tag-c","tag-epoll","tag-linux","tag-socket"],"_links":{"self":[{"href":"https:\/\/guapicoding.com\/index.php?rest_route=\/wp\/v2\/posts\/2280","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/guapicoding.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/guapicoding.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/guapicoding.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/guapicoding.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=2280"}],"version-history":[{"count":5,"href":"https:\/\/guapicoding.com\/index.php?rest_route=\/wp\/v2\/posts\/2280\/revisions"}],"predecessor-version":[{"id":2288,"href":"https:\/\/guapicoding.com\/index.php?rest_route=\/wp\/v2\/posts\/2280\/revisions\/2288"}],"wp:attachment":[{"href":"https:\/\/guapicoding.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=2280"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/guapicoding.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=2280"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/guapicoding.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=2280"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}