加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
WSARecv function (Windows).html 129.72 KB
一键复制 编辑 原始数据 按行查看 历史
Trent Nelson 提交于 2016-10-21 00:21 . Checkpoint commit.
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606
<!DOCTYPE html>
<!-- saved from url=(0083)https://msdn.microsoft.com/en-us/library/windows/desktop/ms741688%28v=vs.85%29.aspx -->
<html dir="ltr" xmlns="http://www.w3.org/1999/xhtml" lang="en"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><link rel="canonical" href="https://msdn.microsoft.com/en-us/library/windows/desktop/ms741688(v=vs.85).aspx">
<title>WSARecv function (Windows)</title>
<meta name="DCS.dcsuri" content="/en-us/library/windows/desktop/ms741688(d=default,l=en-us,v=vs.85).aspx">
<meta name="NormalizedUrl" content="https://msdn.microsoft.com/en-us/library/windows/desktop/ms741688(d=default,l=en-us,v=vs.85).aspx">
<meta name="ms.normalizedurl" content="https://msdn.microsoft.com/en-us/library/windows/desktop/ms741688(d=default,l=en-us,v=vs.85).aspx">
<meta name="VotingContextUrl" content="https://msdn.microsoft.com/en-us/library/windows/desktop/ms741688(d=default,l=en-us,v=vs.85).aspx">
<meta name="MN" content="9DDD8834-4:36:33 PM">
<meta name="Search.ShortId" content="ms741688">
<meta name="ms.shortidmsdn" content="ms741688">
<meta name="Ms.Locale" content="en-us">
<meta name="ms.prodver" content="VS.85">
<meta name="ms.contentlang" content="EN">
<meta name="ms.lang" content="EN">
<meta name="ms.loc" content="US">
<meta name="ms.sitever" content="2015.01.20.2">
<meta name="ms.assetid" content="bfe66e11-e9a7-4321-ad55-3141113e9a03">
<meta name="ms.auth" content="0">
<link rel="shortcut icon" href="https://msdn.microsoft.com/Areas/Epx/Themes/Windows/Content/Winlogo_favicon.ico">
<link rel="stylesheet" type="text/css" href="./WSARecv function (Windows)_files/Combined.css"><style type="text/css"></style><script type="text/javascript" async="" src="./WSARecv function (Windows)_files/ms.js"></script><script type="text/javascript" src="./WSARecv function (Windows)_files/ai.js" async=""></script><script class="mtps-injected">try {
/**/
(window.MTPS || (window.MTPS = {})).cdnDomains || (window.MTPS.cdnDomains = {
"image": "https://i-msdn.sec.s-msft.com",
"js": "https://i2-msdn.sec.s-msft.com",
"css": "https://i-msdn.sec.s-msft.com",
"": "https://",
"xap": "https://msdn.microsoft.com"
});
/**/
} finally { MTPS._injectNextScript_0 && MTPS._injectNextScript_0(); }</script><script class="mtps-injected" src="./WSARecv function (Windows)_files/jquery-1.8.2.min.js"></script><script class="mtps-injected">try {
//
var literalNormalizedUrl = '/en-us/library/windows/desktop/ms741688(l=en-us,v=vs.85).aspx';
var wt_nvr_ru = 'WT_NVR_RU';
var wt_fpcdom = '.microsoft.com';
var wt_domlist = 'msdn.microsoft.com';
var wt_pathlist = '';
var wt_paramlist = 'DCSext.mtps_devcenter';
var wt_siteid = 'MSDN';
var gDomain = 'm.webtrends.com';
var gDcsId = 'dcsmgru7m99k7mqmgrhudo0k8_8c6m';
var gFpc = 'WT_FPC';
if (document.cookie.indexOf(gFpc + "=") == -1) {
var wtidJs = document.createElement("script");
wtidJs.src = "//" + gDomain + "/" + gDcsId + "/wtid.js";
document.getElementsByTagName("head")[0].appendChild(wtidJs);
}
var detectedLocale = 'en-us';
var wtsp = '_msdn_';
var gTrackEvents = '0';
/**/
} finally { MTPS._injectNextScript_2 && MTPS._injectNextScript_2(); }</script><script class="mtps-injected">try {
/**/
var omni_guid = "c068ae2d-a675-46b7-b3a6-29fe9df23e5e";
/**/
} finally { MTPS._injectNextScript_3 && MTPS._injectNextScript_3(); }</script><script class="mtps-injected">try {
//
window.appInsightsId = '60854590-027a-4ae4-98be-2741a40f355f';
//
} finally { MTPS._injectNextScript_4 && MTPS._injectNextScript_4(); }</script><script class="mtps-injected" src="./WSARecv function (Windows)_files/Combined.js"></script><meta name="ms.Center" content="windows desktop"><meta name="ms.Section" content="windows desktop: learn"><meta name="ms.ShortId" content="ms741688"><meta name="ms.TOC" content="windows desktop: learn: ms741688"><script class="mtps-injected" src="./WSARecv function (Windows)_files/SearchBox.jss"></script><script class="mtps-injected" src="./WSARecv function (Windows)_files/Combined(1).js"></script><script class="mtps-injected" src="./WSARecv function (Windows)_files/jquery.tmpl.min.js"></script><script class="mtps-injected" src="./WSARecv function (Windows)_files/Combined(2).js"></script><script src="./WSARecv function (Windows)_files/broker.js"></script><script class="mtps-injected">try {
$(document).ready(function() {
try {
var token = $("#globalRequestVerification input[name='__RequestVerificationToken']").clone();
$("#siteFeedbackForm").append(token);
} catch(err) {
}
});
} finally { MTPS._injectNextScript_10 && MTPS._injectNextScript_10(); }</script><link href="./WSARecv function (Windows)_files/PrintView.css" rel="stylesheet" type="text/css" media="print"></head>
<body class="library Chrome">
<div id="page">
<div id="ux-header" class="ltr en-us">
<div id="headerContainer">
<div id="logoAndSearchBox">
<div id="logo">
<a href="https://msdn.microsoft.com/windows/desktop" title="Windows"><img alt="Windows" src="./WSARecv function (Windows)_files/Windows_logo.png"></a>
</div>
<div id="selectedTab">
<a class="dropDownToggle" href="javascript:void(0);">Dev Center - Desktop</a>
</div>
<div id="toclevel1_menu" style="display: none; left: 125px; top: 57px;">
<ul>
<li><a href="http://dev.windows.com/" title="Windows">Windows</a></li>
<li><a href="http://msdn.microsoft.com/windows/desktop/" title="Desktop">Desktop</a></li>
<li><a href="http://msdn.microsoft.com/windows/hardware/" title="Hardware">Hardware</a></li>
<li><a href="http://msdn.microsoft.com/ie/" title="Internet Explorer">Internet Explorer</a></li>
</ul>
<div style="clear: both"></div>
</div>
<div class="SearchBox">
<form id="HeaderSearchForm" name="HeaderSearchForm" method="get" onsubmit="return Epx.Controls.SearchBox.searchBoxOnSubmit(this);">
<input id="HeaderSearchTextBox" name="query" type="text" maxlength="200" onfocus="Epx.Controls.SearchBox.watermarkFocus(event, this.title)" onblur="Epx.Controls.SearchBox.watermarkBlur(event, this.title)" autocomplete="off">
<button id="HeaderSearchButton" value="" type="submit" class="header-search-button" title="Search"></button>
<div id="SearchFlyoutContainer" style="display: none; text-align: left; border: 1px solid buttonshadow; position: absolute; z-index: 1000; padding: 2px; color: rgb(0, 0, 0); font-family: &#39;Segoe UI&#39;, &#39;Lucida Grande&#39;, Verdana, Arial, Helvetica, sans-serif; font-size: 12px; background-color: rgb(255, 255, 255);"><div id="SuggestionContainer"><ul style="list-style: none; padding: 4px 2px 0px 1px; cursor: pointer; margin: 1px; white-space: nowrap;"></ul></div></div></form>
</div>
<div class="Clear"></div>
</div>
<div class="Clear"></div>
<div class="ux-internav">
<div class="toclevel2">
<a class="normal" href="https://sysdev.microsoft.com/en-us/desktop/" title="Dashboard">Dashboard</a>
<a class="normal" href="http://msdn.microsoft.com/windows/desktop/bg161546.aspx" title="Get started">Get started</a>
<a class="normal" href="http://msdn.microsoft.com/windows/desktop/aa511258.aspx" title="Design">Design</a>
<a class="active" href="http://msdn.microsoft.com/windows/desktop/aa904962.aspx" title="Develop">Develop</a>
<a class="normal" href="http://msdn.microsoft.com/windows/desktop/dn553326.aspx" title="Test and deploy">Test and deploy</a>
<a class="normal" href="http://msdn.microsoft.com/windows/desktop/jj134964.aspx" title="Certify">Certify</a>
</div>
<div class="clear"></div>
</div>
<div id="signIn">
<a class="scarabLink" href="https://login.live.com/login.srf?wa=wsignin1.0&rpsnv=12&ct=1422059793&rver=6.0.5276.0&wp=MCMBI&wlcxt=MSDN%24MSDN%24MSDN&wreply=https%3a%2f%2fmsdn.microsoft.com%2fen-us%2flibrary%2fwindows%2fdesktop%2fms741688%2528v%3dvs.85%2529.aspx&lc=1033&id=254354&mkt=en-US" title="Sign in">Sign in</a></div>
</div>
<div id="blackBar">
<div class="toclevel3">
<a class="active" href="http://msdn.microsoft.com/en-us/library/windows/desktop/bg126469.aspx" title="Desktop technologies" style="opacity: 1; left: 0px;">Desktop technologies</a>
<a class="normal" href="http://msdn.microsoft.com/en-us/library/windows/desktop/bg125390.aspx" title="Server and system " style="opacity: 1; left: 0px;">Server and system </a>
<a class="normal" href="http://msdn.microsoft.com/en-us/library/windows/desktop/hh920508(vs.85).aspx" title="API index" style="opacity: 1; left: 0px;">API index</a>
<a class="normal" href="http://code.msdn.microsoft.com/windowsdesktop/" title="Samples" style="opacity: 1; left: 0px;">Samples</a>
<a class="normal" href="http://msdn.microsoft.com/windows/desktop/aa904945.aspx" title="Community" style="opacity: 1; left: 0px;">Community</a>
</div>
<div class="clear"></div>
</div>
</div>
<div id="body">
<div id="leftNav" style="width: 228.5px; max-width: 480px; min-height: 13005px; height: 4158px;">
<div id="tocnav" style="width: 229px; position: fixed; top: -2170px;">
<div class="toclevel0" data-toclevel="0" style="padding-left: 0px;">
<a class="toc_collapsed" href="https://msdn.microsoft.com/en-us/library/windows/desktop/ms741688%28v=vs.85%29.aspx#"></a><a data-tochassubtree="true" href="https://msdn.microsoft.com/en-us/library/windows/desktop/ee663286(v=vs.85).aspx" id="bg126531_VS.85_en-us" mtpsaliasid="" mtpsassetid="f80bf168-4936-4736-bc62-d0a557b3cd58_VS.85_en-us" mtpsshortid="ee663286_VS.85_en-us" title="Networking and Internet">Networking and Internet</a> </div>
<div class="toclevel0" data-toclevel="0" style="padding-left: 0px;">
<a class="toc_collapsed" href="https://msdn.microsoft.com/en-us/library/windows/desktop/ms741688%28v=vs.85%29.aspx#"></a><a data-tochassubtree="true" href="https://msdn.microsoft.com/en-us/library/windows/desktop/ms740673(v=vs.85).aspx" id="ms767900_VS.85_en-us" mtpsaliasid="" mtpsassetid="1ec8758a-40fd-4c98-b839-c2409ef712d6_VS.85_en-us" mtpsshortid="ms740673_VS.85_en-us" title="Windows Sockets 2">Windows Sockets 2</a> </div>
<div class="toclevel0" data-toclevel="0" style="padding-left: 0px;">
<a class="toc_collapsed" href="https://msdn.microsoft.com/en-us/library/windows/desktop/ms741688%28v=vs.85%29.aspx#"></a><a data-tochassubtree="true" href="https://msdn.microsoft.com/en-us/library/windows/desktop/ms741416(v=vs.85).aspx" id="ms768062_VS.85_en-us" mtpsaliasid="" mtpsassetid="baae2bf9-f505-4365-b60e-e3247a0218c8_VS.85_en-us" mtpsshortid="ms741416_VS.85_en-us" title="Winsock Reference">Winsock Reference</a> </div>
<div class="toclevel1" data-toclevel="1" data-childrenloaded="true" style="padding-left: 13px;">
<a class="toc_expanded" href="https://msdn.microsoft.com/en-us/library/windows/desktop/ms741688%28v=vs.85%29.aspx#"></a><a data-tochassubtree="true" href="https://msdn.microsoft.com/en-us/library/windows/desktop/ms741394(v=vs.85).aspx" id="ms768130_VS.85_en-us" mtpsaliasid="" mtpsassetid="edafb5f9-09fe-4f8e-9651-4002b6f622f4_VS.85_en-us" mtpsshortid="ms741394_VS.85_en-us" title="Winsock Functions">Winsock Functions</a> </div>
<div class="toclevel2" data-toclevel="2" style="padding-left: 26px;">
<span class="toc_empty"></span><a href="https://msdn.microsoft.com/en-us/library/windows/desktop/ms737526(v=vs.85).aspx" mtpsaliasid="" mtpsassetid="" mtpsshortid="" title="accept">accept</a> </div>
<div class="toclevel2" data-toclevel="2" style="padding-left: 26px;">
<span class="toc_empty"></span><a href="https://msdn.microsoft.com/en-us/library/windows/desktop/ms737524(v=vs.85).aspx" mtpsaliasid="" mtpsassetid="" mtpsshortid="" title="AcceptEx">AcceptEx</a> </div>
<div class="toclevel2" data-toclevel="2" style="padding-left: 26px;">
<span class="toc_empty"></span><a href="https://msdn.microsoft.com/en-us/library/windows/desktop/ms737550(v=vs.85).aspx" mtpsaliasid="" mtpsassetid="" mtpsshortid="" title="bind">bind</a> </div>
<div class="toclevel2" data-toclevel="2" style="padding-left: 26px;">
<span class="toc_empty"></span><a href="https://msdn.microsoft.com/en-us/library/windows/desktop/ms737582(v=vs.85).aspx" mtpsaliasid="" mtpsassetid="" mtpsshortid="" title="closesocket">closesocket</a> </div>
<div class="toclevel2" data-toclevel="2" style="padding-left: 26px;">
<span class="toc_empty"></span><a href="https://msdn.microsoft.com/en-us/library/windows/desktop/ms737625(v=vs.85).aspx" mtpsaliasid="" mtpsassetid="" mtpsshortid="" title="connect">connect</a> </div>
<div class="toclevel2" data-toclevel="2" style="padding-left: 26px;">
<span class="toc_empty"></span><a href="https://msdn.microsoft.com/en-us/library/windows/desktop/ms737606(v=vs.85).aspx" mtpsaliasid="" mtpsassetid="" mtpsshortid="" title="ConnectEx">ConnectEx</a> </div>
<div class="toclevel2" data-toclevel="2" style="padding-left: 26px;">
<span class="toc_empty"></span><a href="https://msdn.microsoft.com/en-us/library/windows/desktop/ms737757(v=vs.85).aspx" mtpsaliasid="" mtpsassetid="" mtpsshortid="" title="DisconnectEx">DisconnectEx</a> </div>
<div class="toclevel2" data-toclevel="2" style="padding-left: 26px;">
<span class="toc_empty"></span><a href="https://msdn.microsoft.com/en-us/library/windows/desktop/ms737823(v=vs.85).aspx" mtpsaliasid="" mtpsassetid="" mtpsshortid="" title="EnumProtocols">EnumProtocols</a> </div>
<div class="toclevel2" data-toclevel="2" style="padding-left: 26px;">
<span class="toc_empty"></span><a href="https://msdn.microsoft.com/en-us/library/windows/desktop/ms737931(v=vs.85).aspx" mtpsaliasid="" mtpsassetid="" mtpsshortid="" title="freeaddrinfo">freeaddrinfo</a> </div>
<div class="toclevel2" data-toclevel="2" style="padding-left: 26px;">
<span class="toc_empty"></span><a href="https://msdn.microsoft.com/en-us/library/windows/desktop/ms737906(v=vs.85).aspx" mtpsaliasid="" mtpsassetid="" mtpsshortid="" title="FreeAddrInfoEx">FreeAddrInfoEx</a> </div>
<div class="toclevel2" data-toclevel="2" style="padding-left: 26px;">
<span class="toc_empty"></span><a href="https://msdn.microsoft.com/en-us/library/windows/desktop/ms737912(v=vs.85).aspx" mtpsaliasid="" mtpsassetid="" mtpsshortid="" title="FreeAddrInfoW">FreeAddrInfoW</a> </div>
<div class="toclevel2" data-toclevel="2" style="padding-left: 26px;">
<span class="toc_empty"></span><a href="https://msdn.microsoft.com/en-us/library/windows/desktop/ms738514(v=vs.85).aspx" mtpsaliasid="" mtpsassetid="" mtpsshortid="" title="gai_strerror">gai_strerror</a> </div>
<div class="toclevel2" data-toclevel="2" style="padding-left: 26px;">
<span class="toc_empty"></span><a href="https://msdn.microsoft.com/en-us/library/windows/desktop/ms738516(v=vs.85).aspx" mtpsaliasid="" mtpsassetid="" mtpsshortid="" title="GetAcceptExSockaddrs">GetAcceptExSockaddrs</a> </div>
<div class="toclevel2" data-toclevel="2" style="padding-left: 26px;">
<span class="toc_empty"></span><a href="https://msdn.microsoft.com/en-us/library/windows/desktop/ms738517(v=vs.85).aspx" mtpsaliasid="" mtpsassetid="" mtpsshortid="" title="GetAddressByName">GetAddressByName</a> </div>
<div class="toclevel2" data-toclevel="2" style="padding-left: 26px;">
<span class="toc_empty"></span><a href="https://msdn.microsoft.com/en-us/library/windows/desktop/ms738520(v=vs.85).aspx" mtpsaliasid="" mtpsassetid="" mtpsshortid="" title="getaddrinfo">getaddrinfo</a> </div>
<div class="toclevel2" data-toclevel="2" style="padding-left: 26px;">
<span class="toc_empty"></span><a href="https://msdn.microsoft.com/en-us/library/windows/desktop/ms738518(v=vs.85).aspx" mtpsaliasid="" mtpsassetid="" mtpsshortid="" title="GetAddrInfoEx">GetAddrInfoEx</a> </div>
<div class="toclevel2" data-toclevel="2" style="padding-left: 26px;">
<span class="toc_empty"></span><a href="https://msdn.microsoft.com/en-us/library/windows/desktop/hh448782(v=vs.85).aspx" mtpsaliasid="" mtpsassetid="" mtpsshortid="" title="GetAddrInfoExCancel">GetAddrInfoExCancel</a> </div>
<div class="toclevel2" data-toclevel="2" style="padding-left: 26px;">
<span class="toc_empty"></span><a href="https://msdn.microsoft.com/en-us/library/windows/desktop/hh448783(v=vs.85).aspx" mtpsaliasid="" mtpsassetid="" mtpsshortid="" title="GetAddrInfoExOverlappedResult">GetAddrInfoExOverlappedResult</a> </div>
<div class="toclevel2" data-toclevel="2" style="padding-left: 26px;">
<span class="toc_empty"></span><a href="https://msdn.microsoft.com/en-us/library/windows/desktop/ms738519(v=vs.85).aspx" mtpsaliasid="" mtpsassetid="" mtpsshortid="" title="GetAddrInfoW">GetAddrInfoW</a> </div>
<div class="toclevel2" data-toclevel="2" style="padding-left: 26px;">
<span class="toc_empty"></span><a href="https://msdn.microsoft.com/en-us/library/windows/desktop/ms738521(v=vs.85).aspx" mtpsaliasid="" mtpsassetid="" mtpsshortid="" title="gethostbyaddr">gethostbyaddr</a> </div>
<div class="toclevel2" data-toclevel="2" style="padding-left: 26px;">
<span class="toc_empty"></span><a href="https://msdn.microsoft.com/en-us/library/windows/desktop/ms738524(v=vs.85).aspx" mtpsaliasid="" mtpsassetid="" mtpsshortid="" title="gethostbyname">gethostbyname</a> </div>
<div class="toclevel2" data-toclevel="2" style="padding-left: 26px;">
<span class="toc_empty"></span><a href="https://msdn.microsoft.com/en-us/library/windows/desktop/ms738527(v=vs.85).aspx" mtpsaliasid="" mtpsassetid="" mtpsshortid="" title="gethostname">gethostname</a> </div>
<div class="toclevel2" data-toclevel="2" style="padding-left: 26px;">
<span class="toc_empty"></span><a href="https://msdn.microsoft.com/en-us/library/windows/desktop/dn793576(v=vs.85).aspx" mtpsaliasid="" mtpsassetid="" mtpsshortid="" title="GetHostNameW">GetHostNameW</a> </div>
<div class="toclevel2" data-toclevel="2" style="padding-left: 26px;">
<span class="toc_empty"></span><a href="https://msdn.microsoft.com/en-us/library/windows/desktop/ms738530(v=vs.85).aspx" mtpsaliasid="" mtpsassetid="" mtpsshortid="" title="GetNameByType">GetNameByType</a> </div>
<div class="toclevel2" data-toclevel="2" style="padding-left: 26px;">
<span class="toc_empty"></span><a href="https://msdn.microsoft.com/en-us/library/windows/desktop/ms738532(v=vs.85).aspx" mtpsaliasid="" mtpsassetid="" mtpsshortid="" title="getnameinfo">getnameinfo</a> </div>
<div class="toclevel2" data-toclevel="2" style="padding-left: 26px;">
<span class="toc_empty"></span><a href="https://msdn.microsoft.com/en-us/library/windows/desktop/dn798956(v=vs.85).aspx" mtpsaliasid="" mtpsassetid="" mtpsshortid="" title="getipv4sourcefilter">getipv4sourcefilter</a> </div>
<div class="toclevel2" data-toclevel="2" style="padding-left: 26px;">
<span class="toc_empty"></span><a href="https://msdn.microsoft.com/en-us/library/windows/desktop/ms738531(v=vs.85).aspx" mtpsaliasid="" mtpsassetid="" mtpsshortid="" title="GetNameInfoW">GetNameInfoW</a> </div>
<div class="toclevel2" data-toclevel="2" style="padding-left: 26px;">
<span class="toc_empty"></span><a href="https://msdn.microsoft.com/en-us/library/windows/desktop/ms738533(v=vs.85).aspx" mtpsaliasid="" mtpsassetid="" mtpsshortid="" title="getpeername">getpeername</a> </div>
<div class="toclevel2" data-toclevel="2" style="padding-left: 26px;">
<span class="toc_empty"></span><a href="https://msdn.microsoft.com/en-us/library/windows/desktop/ms738534(v=vs.85).aspx" mtpsaliasid="" mtpsassetid="" mtpsshortid="" title="getprotobyname">getprotobyname</a> </div>
<div class="toclevel2" data-toclevel="2" style="padding-left: 26px;">
<span class="toc_empty"></span><a href="https://msdn.microsoft.com/en-us/library/windows/desktop/ms738537(v=vs.85).aspx" mtpsaliasid="" mtpsassetid="" mtpsshortid="" title="getprotobynumber">getprotobynumber</a> </div>
<div class="toclevel2" data-toclevel="2" style="padding-left: 26px;">
<span class="toc_empty"></span><a href="https://msdn.microsoft.com/en-us/library/windows/desktop/ms738538(v=vs.85).aspx" mtpsaliasid="" mtpsassetid="" mtpsshortid="" title="getservbyname">getservbyname</a> </div>
<div class="toclevel2" data-toclevel="2" style="padding-left: 26px;">
<span class="toc_empty"></span><a href="https://msdn.microsoft.com/en-us/library/windows/desktop/ms738541(v=vs.85).aspx" mtpsaliasid="" mtpsassetid="" mtpsshortid="" title="getservbyport">getservbyport</a> </div>
<div class="toclevel2" data-toclevel="2" style="padding-left: 26px;">
<span class="toc_empty"></span><a href="https://msdn.microsoft.com/en-us/library/windows/desktop/ms738542(v=vs.85).aspx" mtpsaliasid="" mtpsassetid="" mtpsshortid="" title="GetService">GetService</a> </div>
<div class="toclevel2" data-toclevel="2" style="padding-left: 26px;">
<span class="toc_empty"></span><a href="https://msdn.microsoft.com/en-us/library/windows/desktop/ms738543(v=vs.85).aspx" mtpsaliasid="" mtpsassetid="" mtpsshortid="" title="getsockname">getsockname</a> </div>
<div class="toclevel2" data-toclevel="2" style="padding-left: 26px;">
<span class="toc_empty"></span><a href="https://msdn.microsoft.com/en-us/library/windows/desktop/ms738544(v=vs.85).aspx" mtpsaliasid="" mtpsassetid="" mtpsshortid="" title="getsockopt">getsockopt</a> </div>
<div class="toclevel2" data-toclevel="2" style="padding-left: 26px;">
<span class="toc_empty"></span><a href="https://msdn.microsoft.com/en-us/library/windows/desktop/dn798957(v=vs.85).aspx" mtpsaliasid="" mtpsassetid="" mtpsshortid="" title="getsourcefilter">getsourcefilter</a> </div>
<div class="toclevel2" data-toclevel="2" style="padding-left: 26px;">
<span class="toc_empty"></span><a href="https://msdn.microsoft.com/en-us/library/windows/desktop/ms738546(v=vs.85).aspx" mtpsaliasid="" mtpsassetid="" mtpsshortid="" title="GetTypeByName">GetTypeByName</a> </div>
<div class="toclevel2" data-toclevel="2" style="padding-left: 26px;">
<span class="toc_empty"></span><a href="https://msdn.microsoft.com/en-us/library/windows/desktop/jj710197(v=vs.85).aspx" mtpsaliasid="" mtpsassetid="" mtpsshortid="" title="htond">htond</a> </div>
<div class="toclevel2" data-toclevel="2" style="padding-left: 26px;">
<span class="toc_empty"></span><a href="https://msdn.microsoft.com/en-us/library/windows/desktop/jj710198(v=vs.85).aspx" mtpsaliasid="" mtpsassetid="" mtpsshortid="" title="htonf">htonf</a> </div>
<div class="toclevel2" data-toclevel="2" style="padding-left: 26px;">
<span class="toc_empty"></span><a href="https://msdn.microsoft.com/en-us/library/windows/desktop/ms738556(v=vs.85).aspx" mtpsaliasid="" mtpsassetid="" mtpsshortid="" title="htonl">htonl</a> </div>
<div class="toclevel2" data-toclevel="2" style="padding-left: 26px;">
<span class="toc_empty"></span><a href="https://msdn.microsoft.com/en-us/library/windows/desktop/jj710199(v=vs.85).aspx" mtpsaliasid="" mtpsassetid="" mtpsshortid="" title="htonll">htonll</a> </div>
<div class="toclevel2" data-toclevel="2" style="padding-left: 26px;">
<span class="toc_empty"></span><a href="https://msdn.microsoft.com/en-us/library/windows/desktop/ms738557(v=vs.85).aspx" mtpsaliasid="" mtpsassetid="" mtpsshortid="" title="htons">htons</a> </div>
<div class="toclevel2" data-toclevel="2" style="padding-left: 26px;">
<span class="toc_empty"></span><a href="https://msdn.microsoft.com/en-us/library/windows/desktop/ms738563(v=vs.85).aspx" mtpsaliasid="" mtpsassetid="" mtpsshortid="" title="inet_addr">inet_addr</a> </div>
<div class="toclevel2" data-toclevel="2" style="padding-left: 26px;">
<span class="toc_empty"></span><a href="https://msdn.microsoft.com/en-us/library/windows/desktop/ms738564(v=vs.85).aspx" mtpsaliasid="" mtpsassetid="" mtpsshortid="" title="inet_ntoa">inet_ntoa</a> </div>
<div class="toclevel2" data-toclevel="2" style="padding-left: 26px;">
<span class="toc_empty"></span><a href="https://msdn.microsoft.com/en-us/library/windows/desktop/cc805843(v=vs.85).aspx" mtpsaliasid="" mtpsassetid="" mtpsshortid="" title="InetNtop">InetNtop</a> </div>
<div class="toclevel2" data-toclevel="2" style="padding-left: 26px;">
<span class="toc_empty"></span><a href="https://msdn.microsoft.com/en-us/library/windows/desktop/cc805844(v=vs.85).aspx" mtpsaliasid="" mtpsassetid="" mtpsshortid="" title="InetPton">InetPton</a> </div>
<div class="toclevel2" data-toclevel="2" style="padding-left: 26px;">
<span class="toc_empty"></span><a href="https://msdn.microsoft.com/en-us/library/windows/desktop/ms738573(v=vs.85).aspx" mtpsaliasid="" mtpsassetid="" mtpsshortid="" title="ioctlsocket">ioctlsocket</a> </div>
<div class="toclevel2" data-toclevel="2" style="padding-left: 26px;">
<span class="toc_empty"></span><a href="https://msdn.microsoft.com/en-us/library/windows/desktop/ms739168(v=vs.85).aspx" mtpsaliasid="" mtpsassetid="" mtpsshortid="" title="listen">listen</a> </div>
<div class="toclevel2" data-toclevel="2" style="padding-left: 26px;">
<span class="toc_empty"></span><a href="https://msdn.microsoft.com/en-us/library/windows/desktop/jj710200(v=vs.85).aspx" mtpsaliasid="" mtpsassetid="" mtpsshortid="" title="ntohd">ntohd</a> </div>
<div class="toclevel2" data-toclevel="2" style="padding-left: 26px;">
<span class="toc_empty"></span><a href="https://msdn.microsoft.com/en-us/library/windows/desktop/jj710201(v=vs.85).aspx" mtpsaliasid="" mtpsassetid="" mtpsshortid="" title="ntohf">ntohf</a> </div>
<div class="toclevel2" data-toclevel="2" style="padding-left: 26px;">
<span class="toc_empty"></span><a href="https://msdn.microsoft.com/en-us/library/windows/desktop/ms740069(v=vs.85).aspx" mtpsaliasid="" mtpsassetid="" mtpsshortid="" title="ntohl">ntohl</a> </div>
<div class="toclevel2" data-toclevel="2" style="padding-left: 26px;">
<span class="toc_empty"></span><a href="https://msdn.microsoft.com/en-us/library/windows/desktop/jj710202(v=vs.85).aspx" mtpsaliasid="" mtpsassetid="" mtpsshortid="" title="ntohll">ntohll</a> </div>
<div class="toclevel2" data-toclevel="2" style="padding-left: 26px;">
<span class="toc_empty"></span><a href="https://msdn.microsoft.com/en-us/library/windows/desktop/ms740075(v=vs.85).aspx" mtpsaliasid="" mtpsassetid="" mtpsshortid="" title="ntohs">ntohs</a> </div>
<div class="toclevel2" data-toclevel="2" style="padding-left: 26px;">
<span class="toc_empty"></span><a href="https://msdn.microsoft.com/en-us/library/windows/desktop/ms740121(v=vs.85).aspx" mtpsaliasid="" mtpsassetid="" mtpsshortid="" title="recv">recv</a> </div>
<div class="toclevel2" data-toclevel="2" style="padding-left: 26px;">
<span class="toc_empty"></span><a href="https://msdn.microsoft.com/en-us/library/windows/desktop/ms740120(v=vs.85).aspx" mtpsaliasid="" mtpsassetid="" mtpsshortid="" title="recvfrom">recvfrom</a> </div>
<div class="toclevel2" data-toclevel="2" style="padding-left: 26px;">
<span class="toc_empty"></span><a href="https://msdn.microsoft.com/en-us/library/windows/desktop/hh448837(v=vs.85).aspx" mtpsaliasid="" mtpsassetid="" mtpsshortid="" title="RIOCloseCompletionQueue">RIOCloseCompletionQueue</a> </div>
<div class="toclevel2" data-toclevel="2" style="padding-left: 26px;">
<span class="toc_empty"></span><a href="https://msdn.microsoft.com/en-us/library/windows/desktop/hh448841(v=vs.85).aspx" mtpsaliasid="" mtpsassetid="" mtpsshortid="" title="RIOCreateCompletionQueue">RIOCreateCompletionQueue</a> </div>
<div class="toclevel2" data-toclevel="2" style="padding-left: 26px;">
<span class="toc_empty"></span><a href="https://msdn.microsoft.com/en-us/library/windows/desktop/hh448843(v=vs.85).aspx" mtpsaliasid="" mtpsassetid="" mtpsshortid="" title="RIOCreateRequestQueue">RIOCreateRequestQueue</a> </div>
<div class="toclevel2" data-toclevel="2" style="padding-left: 26px;">
<span class="toc_empty"></span><a href="https://msdn.microsoft.com/en-us/library/windows/desktop/hh448845(v=vs.85).aspx" mtpsaliasid="" mtpsassetid="" mtpsshortid="" title="RIODequeueCompletion">RIODequeueCompletion</a> </div>
<div class="toclevel2" data-toclevel="2" style="padding-left: 26px;">
<span class="toc_empty"></span><a href="https://msdn.microsoft.com/en-us/library/windows/desktop/hh448847(v=vs.85).aspx" mtpsaliasid="" mtpsassetid="" mtpsshortid="" title="RIODeregisterBuffer">RIODeregisterBuffer</a> </div>
<div class="toclevel2" data-toclevel="2" style="padding-left: 26px;">
<span class="toc_empty"></span><a href="https://msdn.microsoft.com/en-us/library/windows/desktop/hh437191(v=vs.85).aspx" mtpsaliasid="" mtpsassetid="" mtpsshortid="" title="RIONotify">RIONotify</a> </div>
<div class="toclevel2" data-toclevel="2" style="padding-left: 26px;">
<span class="toc_empty"></span><a href="https://msdn.microsoft.com/en-us/library/windows/desktop/hh437193(v=vs.85).aspx" mtpsaliasid="" mtpsassetid="" mtpsshortid="" title="RIOReceive">RIOReceive</a> </div>
<div class="toclevel2" data-toclevel="2" style="padding-left: 26px;">
<span class="toc_empty"></span><a href="https://msdn.microsoft.com/en-us/library/windows/desktop/hh437196(v=vs.85).aspx" mtpsaliasid="" mtpsassetid="" mtpsshortid="" title="RIOReceiveEx">RIOReceiveEx</a> </div>
<div class="toclevel2" data-toclevel="2" style="padding-left: 26px;">
<span class="toc_empty"></span><a href="https://msdn.microsoft.com/en-us/library/windows/desktop/hh437199(v=vs.85).aspx" mtpsaliasid="" mtpsassetid="" mtpsshortid="" title="RIORegisterBuffer">RIORegisterBuffer</a> </div>
<div class="toclevel2" data-toclevel="2" style="padding-left: 26px;">
<span class="toc_empty"></span><a href="https://msdn.microsoft.com/en-us/library/windows/desktop/hh437202(v=vs.85).aspx" mtpsaliasid="" mtpsassetid="" mtpsshortid="" title="RIOResizeCompletionQueue">RIOResizeCompletionQueue</a> </div>
<div class="toclevel2" data-toclevel="2" style="padding-left: 26px;">
<span class="toc_empty"></span><a href="https://msdn.microsoft.com/en-us/library/windows/desktop/hh437204(v=vs.85).aspx" mtpsaliasid="" mtpsassetid="" mtpsshortid="" title="RIOResizeRequestQueue">RIOResizeRequestQueue</a> </div>
<div class="toclevel2" data-toclevel="2" style="padding-left: 26px;">
<span class="toc_empty"></span><a href="https://msdn.microsoft.com/en-us/library/windows/desktop/hh437213(v=vs.85).aspx" mtpsaliasid="" mtpsassetid="" mtpsshortid="" title="RIOSend">RIOSend</a> </div>
<div class="toclevel2" data-toclevel="2" style="padding-left: 26px;">
<span class="toc_empty"></span><a href="https://msdn.microsoft.com/en-us/library/windows/desktop/hh437216(v=vs.85).aspx" mtpsaliasid="" mtpsassetid="" mtpsshortid="" title="RIOSendEx">RIOSendEx</a> </div>
<div class="toclevel2" data-toclevel="2" style="padding-left: 26px;">
<span class="toc_empty"></span><a href="https://msdn.microsoft.com/en-us/library/windows/desktop/ms740141(v=vs.85).aspx" mtpsaliasid="" mtpsassetid="" mtpsshortid="" title="select">select</a> </div>
<div class="toclevel2" data-toclevel="2" style="padding-left: 26px;">
<span class="toc_empty"></span><a href="https://msdn.microsoft.com/en-us/library/windows/desktop/ms740149(v=vs.85).aspx" mtpsaliasid="" mtpsassetid="" mtpsshortid="" title="send">send</a> </div>
<div class="toclevel2" data-toclevel="2" style="padding-left: 26px;">
<span class="toc_empty"></span><a href="https://msdn.microsoft.com/en-us/library/windows/desktop/ms740148(v=vs.85).aspx" mtpsaliasid="" mtpsassetid="" mtpsshortid="" title="sendto">sendto</a> </div>
<div class="toclevel2" data-toclevel="2" style="padding-left: 26px;">
<span class="toc_empty"></span><a href="https://msdn.microsoft.com/en-us/library/windows/desktop/ms740473(v=vs.85).aspx" mtpsaliasid="" mtpsassetid="" mtpsshortid="" title="SetAddrInfoEx">SetAddrInfoEx</a> </div>
<div class="toclevel2" data-toclevel="2" style="padding-left: 26px;">
<span class="toc_empty"></span><a href="https://msdn.microsoft.com/en-us/library/windows/desktop/dn798958(v=vs.85).aspx" mtpsaliasid="" mtpsassetid="" mtpsshortid="" title="setipv4sourcefilter">setipv4sourcefilter</a> </div>
<div class="toclevel2" data-toclevel="2" style="padding-left: 26px;">
<span class="toc_empty"></span><a href="https://msdn.microsoft.com/en-us/library/windows/desktop/ms740475(v=vs.85).aspx" mtpsaliasid="" mtpsassetid="" mtpsshortid="" title="SetService">SetService</a> </div>
<div class="toclevel2" data-toclevel="2" style="padding-left: 26px;">
<span class="toc_empty"></span><a href="https://msdn.microsoft.com/en-us/library/windows/desktop/hh994468(v=vs.85).aspx" mtpsaliasid="" mtpsassetid="" mtpsshortid="" title="SetSocketMediaStreamingMode">SetSocketMediaStreamingMode</a> </div>
<div class="toclevel2" data-toclevel="2" style="padding-left: 26px;">
<span class="toc_empty"></span><a href="https://msdn.microsoft.com/en-us/library/windows/desktop/ms740476(v=vs.85).aspx" mtpsaliasid="" mtpsassetid="" mtpsshortid="" title="setsockopt">setsockopt</a> </div>
<div class="toclevel2" data-toclevel="2" style="padding-left: 26px;">
<span class="toc_empty"></span><a href="https://msdn.microsoft.com/en-us/library/windows/desktop/dn798959(v=vs.85).aspx" mtpsaliasid="" mtpsassetid="" mtpsshortid="" title="setsourcefilter">setsourcefilter</a> </div>
<div class="toclevel2" data-toclevel="2" style="padding-left: 26px;">
<span class="toc_empty"></span><a href="https://msdn.microsoft.com/en-us/library/windows/desktop/ms740481(v=vs.85).aspx" mtpsaliasid="" mtpsassetid="" mtpsshortid="" title="shutdown">shutdown</a> </div>
<div class="toclevel2" data-toclevel="2" style="padding-left: 26px;">
<span class="toc_empty"></span><a href="https://msdn.microsoft.com/en-us/library/windows/desktop/ms740506(v=vs.85).aspx" mtpsaliasid="" mtpsassetid="" mtpsshortid="" title="socket">socket</a> </div>
<div class="toclevel2" data-toclevel="2" style="padding-left: 26px;">
<span class="toc_empty"></span><a href="https://msdn.microsoft.com/en-us/library/windows/desktop/ms740565(v=vs.85).aspx" mtpsaliasid="" mtpsassetid="" mtpsshortid="" title="TransmitFile">TransmitFile</a> </div>
<div class="toclevel2" data-toclevel="2" style="padding-left: 26px;">
<span class="toc_empty"></span><a href="https://msdn.microsoft.com/en-us/library/windows/desktop/ms740566(v=vs.85).aspx" mtpsaliasid="" mtpsassetid="" mtpsshortid="" title="TransmitPackets">TransmitPackets</a> </div>
<div class="toclevel2" data-toclevel="2" style="padding-left: 26px;">
<span class="toc_empty"></span><a href="https://msdn.microsoft.com/en-us/library/windows/desktop/ms741513(v=vs.85).aspx" mtpsaliasid="" mtpsassetid="" mtpsshortid="" title="WSAAccept">WSAAccept</a> </div>
<div class="toclevel2" data-toclevel="2" style="padding-left: 26px;">
<span class="toc_empty"></span><a href="https://msdn.microsoft.com/en-us/library/windows/desktop/ms741516(v=vs.85).aspx" mtpsaliasid="" mtpsassetid="" mtpsshortid="" title="WSAAddressToString">WSAAddressToString</a> </div>
<div class="toclevel2" data-toclevel="2" style="padding-left: 26px;">
<span class="toc_empty"></span><a href="https://msdn.microsoft.com/en-us/library/windows/desktop/ms741519(v=vs.85).aspx" mtpsaliasid="" mtpsassetid="" mtpsshortid="" title="WSAAsyncGetHostByAddr">WSAAsyncGetHostByAddr</a> </div>
<div class="toclevel2" data-toclevel="2" style="padding-left: 26px;">
<span class="toc_empty"></span><a href="https://msdn.microsoft.com/en-us/library/windows/desktop/ms741522(v=vs.85).aspx" mtpsaliasid="" mtpsassetid="" mtpsshortid="" title="WSAAsyncGetHostByName">WSAAsyncGetHostByName</a> </div>
<div class="toclevel2" data-toclevel="2" style="padding-left: 26px;">
<span class="toc_empty"></span><a href="https://msdn.microsoft.com/en-us/library/windows/desktop/ms741526(v=vs.85).aspx" mtpsaliasid="" mtpsassetid="" mtpsshortid="" title="WSAAsyncGetProtoByName">WSAAsyncGetProtoByName</a> </div>
<div class="toclevel2" data-toclevel="2" style="padding-left: 26px;">
<span class="toc_empty"></span><a href="https://msdn.microsoft.com/en-us/library/windows/desktop/ms741529(v=vs.85).aspx" mtpsaliasid="" mtpsassetid="" mtpsshortid="" title="WSAAsyncGetProtoByNumber">WSAAsyncGetProtoByNumber</a> </div>
<div class="toclevel2" data-toclevel="2" style="padding-left: 26px;">
<span class="toc_empty"></span><a href="https://msdn.microsoft.com/en-us/library/windows/desktop/ms741533(v=vs.85).aspx" mtpsaliasid="" mtpsassetid="" mtpsshortid="" title="WSAAsyncGetServByName">WSAAsyncGetServByName</a> </div>
<div class="toclevel2" data-toclevel="2" style="padding-left: 26px;">
<span class="toc_empty"></span><a href="https://msdn.microsoft.com/en-us/library/windows/desktop/ms741536(v=vs.85).aspx" mtpsaliasid="" mtpsassetid="" mtpsshortid="" title="WSAAsyncGetServByPort">WSAAsyncGetServByPort</a> </div>
<div class="toclevel2" data-toclevel="2" style="padding-left: 26px;">
<span class="toc_empty"></span><a href="https://msdn.microsoft.com/en-us/library/windows/desktop/ms741540(v=vs.85).aspx" mtpsaliasid="" mtpsassetid="" mtpsshortid="" title="WSAAsyncSelect">WSAAsyncSelect</a> </div>
<div class="toclevel2" data-toclevel="2" style="padding-left: 26px;">
<span class="toc_empty"></span><a href="https://msdn.microsoft.com/en-us/library/windows/desktop/ms741544(v=vs.85).aspx" mtpsaliasid="" mtpsassetid="" mtpsshortid="" title="WSACancelAsyncRequest">WSACancelAsyncRequest</a> </div>
<div class="toclevel2" data-toclevel="2" style="padding-left: 26px;">
<span class="toc_empty"></span><a href="https://msdn.microsoft.com/en-us/library/windows/desktop/ms741547(v=vs.85).aspx" mtpsaliasid="" mtpsassetid="" mtpsshortid="" title="WSACancelBlockingCall">WSACancelBlockingCall</a> </div>
<div class="toclevel2" data-toclevel="2" style="padding-left: 26px;">
<span class="toc_empty"></span><a href="https://msdn.microsoft.com/en-us/library/windows/desktop/ms741549(v=vs.85).aspx" mtpsaliasid="" mtpsassetid="" mtpsshortid="" title="WSACleanup">WSACleanup</a> </div>
<div class="toclevel2" data-toclevel="2" style="padding-left: 26px;">
<span class="toc_empty"></span><a href="https://msdn.microsoft.com/en-us/library/windows/desktop/ms741551(v=vs.85).aspx" mtpsaliasid="" mtpsassetid="" mtpsshortid="" title="WSACloseEvent">WSACloseEvent</a> </div>
<div class="toclevel2" data-toclevel="2" style="padding-left: 26px;">
<span class="toc_empty"></span><a href="https://msdn.microsoft.com/en-us/library/windows/desktop/ms741559(v=vs.85).aspx" mtpsaliasid="" mtpsassetid="" mtpsshortid="" title="WSAConnect">WSAConnect</a> </div>
<div class="toclevel2" data-toclevel="2" style="padding-left: 26px;">
<span class="toc_empty"></span><a href="https://msdn.microsoft.com/en-us/library/windows/desktop/ms741554(v=vs.85).aspx" mtpsaliasid="" mtpsassetid="" mtpsshortid="" title="WSAConnectByList">WSAConnectByList</a> </div>
<div class="toclevel2" data-toclevel="2" style="padding-left: 26px;">
<span class="toc_empty"></span><a href="https://msdn.microsoft.com/en-us/library/windows/desktop/ms741557(v=vs.85).aspx" mtpsaliasid="" mtpsassetid="" mtpsshortid="" title="WSAConnectByName">WSAConnectByName</a> </div>
<div class="toclevel2" data-toclevel="2" style="padding-left: 26px;">
<span class="toc_empty"></span><a href="https://msdn.microsoft.com/en-us/library/windows/desktop/ms741561(v=vs.85).aspx" mtpsaliasid="" mtpsassetid="" mtpsshortid="" title="WSACreateEvent">WSACreateEvent</a> </div>
<div class="toclevel2" data-toclevel="2" style="padding-left: 26px;">
<span class="toc_empty"></span><a href="https://msdn.microsoft.com/en-us/library/windows/desktop/bb394816(v=vs.85).aspx" mtpsaliasid="" mtpsassetid="" mtpsshortid="" title="WSADeleteSocketPeerTargetName">WSADeleteSocketPeerTargetName</a> </div>
<div class="toclevel2" data-toclevel="2" style="padding-left: 26px;">
<span class="toc_empty"></span><a href="https://msdn.microsoft.com/en-us/library/windows/desktop/ms741565(v=vs.85).aspx" mtpsaliasid="" mtpsassetid="" mtpsshortid="" title="WSADuplicateSocket">WSADuplicateSocket</a> </div>
<div class="toclevel2" data-toclevel="2" style="padding-left: 26px;">
<span class="toc_empty"></span><a href="https://msdn.microsoft.com/en-us/library/windows/desktop/ms741570(v=vs.85).aspx" mtpsaliasid="" mtpsassetid="" mtpsshortid="" title="WSAEnumNameSpaceProviders">WSAEnumNameSpaceProviders</a> </div>
<div class="toclevel2" data-toclevel="2" style="padding-left: 26px;">
<span class="toc_empty"></span><a href="https://msdn.microsoft.com/en-us/library/windows/desktop/ms741568(v=vs.85).aspx" mtpsaliasid="" mtpsassetid="" mtpsshortid="" title="WSAEnumNameSpaceProvidersEx">WSAEnumNameSpaceProvidersEx</a> </div>
<div class="toclevel2" data-toclevel="2" style="padding-left: 26px;">
<span class="toc_empty"></span><a href="https://msdn.microsoft.com/en-us/library/windows/desktop/ms741572(v=vs.85).aspx" mtpsaliasid="" mtpsassetid="" mtpsshortid="" title="WSAEnumNetworkEvents">WSAEnumNetworkEvents</a> </div>
<div class="toclevel2" data-toclevel="2" style="padding-left: 26px;">
<span class="toc_empty"></span><a href="https://msdn.microsoft.com/en-us/library/windows/desktop/ms741574(v=vs.85).aspx" mtpsaliasid="" mtpsassetid="" mtpsshortid="" title="WSAEnumProtocols">WSAEnumProtocols</a> </div>
<div class="toclevel2" data-toclevel="2" style="padding-left: 26px;">
<span class="toc_empty"></span><a href="https://msdn.microsoft.com/en-us/library/windows/desktop/ms741576(v=vs.85).aspx" mtpsaliasid="" mtpsassetid="" mtpsshortid="" title="WSAEventSelect">WSAEventSelect</a> </div>
<div class="toclevel2" data-toclevel="2" style="padding-left: 26px;">
<span class="toc_empty"></span><a href="https://msdn.microsoft.com/en-us/library/windows/desktop/ms741578(v=vs.85).aspx" mtpsaliasid="" mtpsassetid="" mtpsshortid="" title="__WSAFDIsSet">__WSAFDIsSet</a> </div>
<div class="toclevel2" data-toclevel="2" style="padding-left: 26px;">
<span class="toc_empty"></span><a href="https://msdn.microsoft.com/en-us/library/windows/desktop/ms741580(v=vs.85).aspx" mtpsaliasid="" mtpsassetid="" mtpsshortid="" title="WSAGetLastError">WSAGetLastError</a> </div>
<div class="toclevel2" data-toclevel="2" style="padding-left: 26px;">
<span class="toc_empty"></span><a href="https://msdn.microsoft.com/en-us/library/windows/desktop/ms741582(v=vs.85).aspx" mtpsaliasid="" mtpsassetid="" mtpsshortid="" title="WSAGetOverlappedResult">WSAGetOverlappedResult</a> </div>
<div class="toclevel2" data-toclevel="2" style="padding-left: 26px;">
<span class="toc_empty"></span><a href="https://msdn.microsoft.com/en-us/library/windows/desktop/ms741587(v=vs.85).aspx" mtpsaliasid="" mtpsassetid="" mtpsshortid="" title="WSAGetQOSByName">WSAGetQOSByName</a> </div>
<div class="toclevel2" data-toclevel="2" style="padding-left: 26px;">
<span class="toc_empty"></span><a href="https://msdn.microsoft.com/en-us/library/windows/desktop/ms741592(v=vs.85).aspx" mtpsaliasid="" mtpsassetid="" mtpsshortid="" title="WSAGetServiceClassInfo">WSAGetServiceClassInfo</a> </div>
<div class="toclevel2" data-toclevel="2" style="padding-left: 26px;">
<span class="toc_empty"></span><a href="https://msdn.microsoft.com/en-us/library/windows/desktop/ms741598(v=vs.85).aspx" mtpsaliasid="" mtpsassetid="" mtpsshortid="" title="WSAGetServiceClassNameByClassId">WSAGetServiceClassNameByClassId</a> </div>
<div class="toclevel2" data-toclevel="2" style="padding-left: 26px;">
<span class="toc_empty"></span><a href="https://msdn.microsoft.com/en-us/library/windows/desktop/ms741604(v=vs.85).aspx" mtpsaliasid="" mtpsassetid="" mtpsshortid="" title="WSAHtonl">WSAHtonl</a> </div>
<div class="toclevel2" data-toclevel="2" style="padding-left: 26px;">
<span class="toc_empty"></span><a href="https://msdn.microsoft.com/en-us/library/windows/desktop/ms741609(v=vs.85).aspx" mtpsaliasid="" mtpsassetid="" mtpsshortid="" title="WSAHtons">WSAHtons</a> </div>
<div class="toclevel2" data-toclevel="2" style="padding-left: 26px;">
<span class="toc_empty"></span><a href="https://msdn.microsoft.com/en-us/library/windows/desktop/bb394817(v=vs.85).aspx" mtpsaliasid="" mtpsassetid="" mtpsshortid="" title="WSAImpersonateSocketPeer">WSAImpersonateSocketPeer</a> </div>
<div class="toclevel2" data-toclevel="2" style="padding-left: 26px;">
<span class="toc_empty"></span><a href="https://msdn.microsoft.com/en-us/library/windows/desktop/ms741616(v=vs.85).aspx" mtpsaliasid="" mtpsassetid="" mtpsshortid="" title="WSAInstallServiceClass">WSAInstallServiceClass</a> </div>
<div class="toclevel2" data-toclevel="2" style="padding-left: 26px;">
<span class="toc_empty"></span><a href="https://msdn.microsoft.com/en-us/library/windows/desktop/ms741621(v=vs.85).aspx" mtpsaliasid="" mtpsassetid="" mtpsshortid="" title="WSAIoctl">WSAIoctl</a> </div>
<div class="toclevel2" data-toclevel="2" style="padding-left: 26px;">
<span class="toc_empty"></span><a href="https://msdn.microsoft.com/en-us/library/windows/desktop/ms741625(v=vs.85).aspx" mtpsaliasid="" mtpsassetid="" mtpsshortid="" title="WSAIsBlocking">WSAIsBlocking</a> </div>
<div class="toclevel2" data-toclevel="2" style="padding-left: 26px;">
<span class="toc_empty"></span><a href="https://msdn.microsoft.com/en-us/library/windows/desktop/ms741628(v=vs.85).aspx" mtpsaliasid="" mtpsassetid="" mtpsshortid="" title="WSAJoinLeaf">WSAJoinLeaf</a> </div>
<div class="toclevel2" data-toclevel="2" style="padding-left: 26px;">
<span class="toc_empty"></span><a href="https://msdn.microsoft.com/en-us/library/windows/desktop/ms741633(v=vs.85).aspx" mtpsaliasid="" mtpsassetid="" mtpsshortid="" title="WSALookupServiceBegin">WSALookupServiceBegin</a> </div>
<div class="toclevel2" data-toclevel="2" style="padding-left: 26px;">
<span class="toc_empty"></span><a href="https://msdn.microsoft.com/en-us/library/windows/desktop/ms741637(v=vs.85).aspx" mtpsaliasid="" mtpsassetid="" mtpsshortid="" title="WSALookupServiceEnd">WSALookupServiceEnd</a> </div>
<div class="toclevel2" data-toclevel="2" style="padding-left: 26px;">
<span class="toc_empty"></span><a href="https://msdn.microsoft.com/en-us/library/windows/desktop/ms741641(v=vs.85).aspx" mtpsaliasid="" mtpsassetid="" mtpsshortid="" title="WSALookupServiceNext">WSALookupServiceNext</a> </div>
<div class="toclevel2" data-toclevel="2" style="padding-left: 26px;">
<span class="toc_empty"></span><a href="https://msdn.microsoft.com/en-us/library/windows/desktop/ms741658(v=vs.85).aspx" mtpsaliasid="" mtpsassetid="" mtpsshortid="" title="WSANSPIoctl">WSANSPIoctl</a> </div>
<div class="toclevel2" data-toclevel="2" style="padding-left: 26px;">
<span class="toc_empty"></span><a href="https://msdn.microsoft.com/en-us/library/windows/desktop/ms741660(v=vs.85).aspx" mtpsaliasid="" mtpsassetid="" mtpsshortid="" title="WSANtohl">WSANtohl</a> </div>
<div class="toclevel2" data-toclevel="2" style="padding-left: 26px;">
<span class="toc_empty"></span><a href="https://msdn.microsoft.com/en-us/library/windows/desktop/ms741663(v=vs.85).aspx" mtpsaliasid="" mtpsassetid="" mtpsshortid="" title="WSANtohs">WSANtohs</a> </div>
<div class="toclevel2" data-toclevel="2" style="padding-left: 26px;">
<span class="toc_empty"></span><a href="https://msdn.microsoft.com/en-us/library/windows/desktop/ms741669(v=vs.85).aspx" mtpsaliasid="" mtpsassetid="" mtpsshortid="" title="WSAPoll">WSAPoll</a> </div>
<div class="toclevel2" data-toclevel="2" style="padding-left: 26px;">
<span class="toc_empty"></span><a href="https://msdn.microsoft.com/en-us/library/windows/desktop/bb394820(v=vs.85).aspx" mtpsaliasid="" mtpsassetid="" mtpsshortid="" title="WSAQuerySocketSecurity">WSAQuerySocketSecurity</a> </div>
<div class="toclevel2" data-toclevel="2" style="padding-left: 26px;">
<span class="toc_empty"></span><a href="https://msdn.microsoft.com/en-us/library/windows/desktop/ms741677(v=vs.85).aspx" mtpsaliasid="" mtpsassetid="" mtpsshortid="" title="WSAProviderConfigChange">WSAProviderConfigChange</a> </div>
<div class="toclevel2 current" data-toclevel="2" style="padding-left: 26px;">
<span class="toc_empty"></span><a href="https://msdn.microsoft.com/en-us/library/windows/desktop/ms741688(v=vs.85).aspx" mtpsaliasid="" mtpsassetid="" mtpsshortid="" title="WSARecv">WSARecv</a> </div>
<div class="toclevel2" data-toclevel="2" style="padding-left: 26px;">
<span class="toc_empty"></span><a href="https://msdn.microsoft.com/en-us/library/windows/desktop/ms741682(v=vs.85).aspx" mtpsaliasid="" mtpsassetid="" mtpsshortid="" title="WSARecvDisconnect">WSARecvDisconnect</a> </div>
<div class="toclevel2" data-toclevel="2" style="padding-left: 26px;">
<span class="toc_empty"></span><a href="https://msdn.microsoft.com/en-us/library/windows/desktop/ms741684(v=vs.85).aspx" mtpsaliasid="" mtpsassetid="" mtpsshortid="" title="WSARecvEx">WSARecvEx</a> </div>
<div class="toclevel2" data-toclevel="2" style="padding-left: 26px;">
<span class="toc_empty"></span><a href="https://msdn.microsoft.com/en-us/library/windows/desktop/ms741686(v=vs.85).aspx" mtpsaliasid="" mtpsassetid="" mtpsshortid="" title="WSARecvFrom">WSARecvFrom</a> </div>
<div class="toclevel2" data-toclevel="2" style="padding-left: 26px;">
<span class="toc_empty"></span><a href="https://msdn.microsoft.com/en-us/library/windows/desktop/ms741687(v=vs.85).aspx" mtpsaliasid="" mtpsassetid="" mtpsshortid="" title="WSARecvMsg">WSARecvMsg</a> </div>
<div class="toclevel2" data-toclevel="2" style="padding-left: 26px;">
<span class="toc_empty"></span><a href="https://msdn.microsoft.com/en-us/library/windows/desktop/ms741689(v=vs.85).aspx" mtpsaliasid="" mtpsassetid="" mtpsshortid="" title="WSARemoveServiceClass">WSARemoveServiceClass</a> </div>
<div class="toclevel2" data-toclevel="2" style="padding-left: 26px;">
<span class="toc_empty"></span><a href="https://msdn.microsoft.com/en-us/library/windows/desktop/ms741690(v=vs.85).aspx" mtpsaliasid="" mtpsassetid="" mtpsshortid="" title="WSAResetEvent">WSAResetEvent</a> </div>
<div class="toclevel2" data-toclevel="2" style="padding-left: 26px;">
<span class="toc_empty"></span><a href="https://msdn.microsoft.com/en-us/library/windows/desktop/bb394821(v=vs.85).aspx" mtpsaliasid="" mtpsassetid="" mtpsshortid="" title="WSARevertImpersonation">WSARevertImpersonation</a> </div>
<div class="toclevel2" data-toclevel="2" style="padding-left: 26px;">
<span class="toc_empty"></span><a href="https://msdn.microsoft.com/en-us/library/windows/desktop/ms742203(v=vs.85).aspx" mtpsaliasid="" mtpsassetid="" mtpsshortid="" title="WSASend">WSASend</a> </div>
<div class="toclevel2" data-toclevel="2" style="padding-left: 26px;">
<span class="toc_empty"></span><a href="https://msdn.microsoft.com/en-us/library/windows/desktop/ms741691(v=vs.85).aspx" mtpsaliasid="" mtpsassetid="" mtpsshortid="" title="WSASendDisconnect">WSASendDisconnect</a> </div>
<div class="toclevel2" data-toclevel="2" style="padding-left: 26px;">
<span class="toc_empty"></span><a href="https://msdn.microsoft.com/en-us/library/windows/desktop/ms741692(v=vs.85).aspx" mtpsaliasid="" mtpsassetid="" mtpsshortid="" title="WSASendMsg">WSASendMsg</a> </div>
<div class="toclevel2" data-toclevel="2" style="padding-left: 26px;">
<span class="toc_empty"></span><a href="https://msdn.microsoft.com/en-us/library/windows/desktop/ms741693(v=vs.85).aspx" mtpsaliasid="" mtpsassetid="" mtpsshortid="" title="WSASendTo">WSASendTo</a> </div>
<div class="toclevel2" data-toclevel="2" style="padding-left: 26px;">
<span class="toc_empty"></span><a href="https://msdn.microsoft.com/en-us/library/windows/desktop/ms742205(v=vs.85).aspx" mtpsaliasid="" mtpsassetid="" mtpsshortid="" title="WSASetBlockingHook">WSASetBlockingHook</a> </div>
<div class="toclevel2" data-toclevel="2" style="padding-left: 26px;">
<span class="toc_empty"></span><a href="https://msdn.microsoft.com/en-us/library/windows/desktop/ms742208(v=vs.85).aspx" mtpsaliasid="" mtpsassetid="" mtpsshortid="" title="WSASetEvent">WSASetEvent</a> </div>
<div class="toclevel2" data-toclevel="2" style="padding-left: 26px;">
<span class="toc_empty"></span><a href="https://msdn.microsoft.com/en-us/library/windows/desktop/ms742209(v=vs.85).aspx" mtpsaliasid="" mtpsassetid="" mtpsshortid="" title="WSASetLastError">WSASetLastError</a> </div>
<div class="toclevel2" data-toclevel="2" style="padding-left: 26px;">
<span class="toc_empty"></span><a href="https://msdn.microsoft.com/en-us/library/windows/desktop/ms742211(v=vs.85).aspx" mtpsaliasid="" mtpsassetid="" mtpsshortid="" title="WSASetService">WSASetService</a> </div>
<div class="toclevel2" data-toclevel="2" style="padding-left: 26px;">
<span class="toc_empty"></span><a href="https://msdn.microsoft.com/en-us/library/windows/desktop/bb394822(v=vs.85).aspx" mtpsaliasid="" mtpsassetid="" mtpsshortid="" title="WSASetSocketPeerTargetName">WSASetSocketPeerTargetName</a> </div>
<div class="toclevel2" data-toclevel="2" style="padding-left: 26px;">
<span class="toc_empty"></span><a href="https://msdn.microsoft.com/en-us/library/windows/desktop/bb394823(v=vs.85).aspx" mtpsaliasid="" mtpsassetid="" mtpsshortid="" title="WSASetSocketSecurity">WSASetSocketSecurity</a> </div>
<div class="toclevel2" data-toclevel="2" style="padding-left: 26px;">
<span class="toc_empty"></span><a href="https://msdn.microsoft.com/en-us/library/windows/desktop/ms742212(v=vs.85).aspx" mtpsaliasid="" mtpsassetid="" mtpsshortid="" title="WSASocket">WSASocket</a> </div>
<div class="toclevel2" data-toclevel="2" style="padding-left: 26px;">
<span class="toc_empty"></span><a href="https://msdn.microsoft.com/en-us/library/windows/desktop/ms742213(v=vs.85).aspx" mtpsaliasid="" mtpsassetid="" mtpsshortid="" title="WSAStartup">WSAStartup</a> </div>
<div class="toclevel2" data-toclevel="2" style="padding-left: 26px;">
<span class="toc_empty"></span><a href="https://msdn.microsoft.com/en-us/library/windows/desktop/ms742214(v=vs.85).aspx" mtpsaliasid="" mtpsassetid="" mtpsshortid="" title="WSAStringToAddress">WSAStringToAddress</a> </div>
<div class="toclevel2" data-toclevel="2" style="padding-left: 26px;">
<span class="toc_empty"></span><a href="https://msdn.microsoft.com/en-us/library/windows/desktop/ms742217(v=vs.85).aspx" mtpsaliasid="" mtpsassetid="" mtpsshortid="" title="WSAUnhookBlockingHook">WSAUnhookBlockingHook</a> </div>
<div class="toclevel2" data-toclevel="2" style="padding-left: 26px;">
<span class="toc_empty"></span><a href="https://msdn.microsoft.com/en-us/library/windows/desktop/ms742219(v=vs.85).aspx" mtpsaliasid="" mtpsassetid="" mtpsshortid="" title="WSAWaitForMultipleEvents">WSAWaitForMultipleEvents</a> </div>
</div>
<div id="toc-resizable-ew" class="toc-resizable-ew"></div>
<a id="NavigationResize" href="javascript:void(0)" style="left: 229px; display: inline-block;">
<img class="cl_nav_resize_open" src="./WSARecv function (Windows)_files/ImageSprite.png" title="Expand" alt="Expand">
<img class="cl_nav_resize_close" src="./WSARecv function (Windows)_files/ImageSprite.png" title="Minimize" alt="Minimize" style="display: none;">
</a>
</div>
<div id="content" class="content" style="margin-left: 229px; width: auto;">
<div class="topic" xmlns="http://www.w3.org/1999/xhtml">
<h1 class="title">WSARecv function</h1>
<div id="mainSection">
<div class="clsServerSDKContent">
</div>
<p>The
<strong>WSARecv</strong> function receives data from a connected socket or a bound connectionless socket.</p>
<h2>Syntax</h2>
<div id="code-snippet-1" class="codeSnippetContainer" xmlns="">
<div class="codeSnippetContainerTabs">
<div class="codeSnippetContainerTabSingle" dir="ltr"><a>C++</a></div>
</div>
<div class="codeSnippetContainerCodeContainer">
<div class="codeSnippetToolBar">
<div class="codeSnippetToolBarText">
<a name="CodeSnippetCopyLink" style="display: none;" title="Copy to clipboard." href="javascript:if (window.epx.codeSnippet)window.epx.codeSnippet.copyCode('CodeSnippetContainerCode_2e54befe-65ab-45a0-b21e-47c9b9e54248');">Copy</a>
</div>
</div>
<div id="CodeSnippetContainerCode_2e54befe-65ab-45a0-b21e-47c9b9e54248" class="codeSnippetContainerCode" dir="ltr">
<div style="color:Black;"><pre>
<span style="color:Blue;">int</span> WSARecv(
_In_&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;SOCKET s,
_Inout_&nbsp;&nbsp;LPWSABUF lpBuffers,
_In_&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;DWORD dwBufferCount,
_Out_&nbsp;&nbsp;&nbsp;&nbsp;LPDWORD lpNumberOfBytesRecvd,
_Inout_&nbsp;&nbsp;LPDWORD lpFlags,
_In_&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;LPWSAOVERLAPPED lpOverlapped,
_In_&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;LPWSAOVERLAPPED_COMPLETION_ROUTINE lpCompletionRoutine
);
</pre></div>
</div>
</div>
</div>
<h2>Parameters</h2>
<dl>
<dt><em>s</em> [in]</dt>
<dd>
<p>A descriptor identifying a connected socket.</p>
</dd>
<dt><em>lpBuffers</em> [in, out]</dt>
<dd>
<p>A pointer to an array of
<a href="https://msdn.microsoft.com/en-us/library/windows/desktop/ms741542(v=vs.85).aspx"><strong xmlns="http://www.w3.org/1999/xhtml">WSABUF</strong></a> structures. Each
<strong>WSABUF</strong> structure contains a pointer to a buffer and the length, in bytes, of the buffer.</p>
</dd>
<dt><em>dwBufferCount</em> [in]</dt>
<dd>
<p>The number of
<a href="https://msdn.microsoft.com/en-us/library/windows/desktop/ms741542(v=vs.85).aspx"><strong xmlns="http://www.w3.org/1999/xhtml">WSABUF</strong></a> structures in the <em>lpBuffers</em> array.</p>
</dd>
<dt><em>lpNumberOfBytesRecvd</em> [out]</dt>
<dd>
<p>A pointer to the number, in bytes, of data received by this call if the receive operation completes immediately. </p>
<p>Use <strong>NULL</strong> for this parameter if the <em>lpOverlapped</em> parameter is not <strong>NULL</strong> to avoid potentially erroneous results. This parameter can be <strong>NULL</strong> only if the <em>lpOverlapped</em> parameter is not <strong>NULL</strong>.</p>
</dd>
<dt><em>lpFlags</em> [in, out]</dt>
<dd>
<p>A pointer to flags used to modify the behavior of the
<strong>WSARecv</strong> function call. For more information, see the Remarks section.</p>
</dd>
<dt><em>lpOverlapped</em> [in]</dt>
<dd>
<p>A pointer to a
<a href="https://msdn.microsoft.com/en-us/library/windows/desktop/ms741665(v=vs.85).aspx"><strong xmlns="http://www.w3.org/1999/xhtml">WSAOVERLAPPED</strong></a> structure (ignored for nonoverlapped sockets).</p>
</dd>
<dt><em>lpCompletionRoutine</em> [in]</dt>
<dd>
<p>A pointer to the completion routine called when the receive operation has been completed (ignored for nonoverlapped sockets).</p>
</dd>
</dl>
<h2>Return value</h2>
<p>If no error occurs and the receive operation has completed immediately,
<strong>WSARecv</strong> returns zero. In this case, the completion routine will have already been scheduled to be called once the calling thread is in the alertable state. Otherwise, a value of <strong>SOCKET_ERROR</strong> is returned, and a specific error code can be retrieved by calling
<a href="https://msdn.microsoft.com/en-us/library/windows/desktop/ms741580(v=vs.85).aspx"><strong xmlns="http://www.w3.org/1999/xhtml">WSAGetLastError</strong></a>. The error code
<a href="https://msdn.microsoft.com/en-us/library/windows/desktop/ms740668(v=vs.85).aspx#WSA_IO_PENDING">WSA_IO_PENDING</a> indicates that the overlapped operation has been successfully initiated and that completion will be indicated at a later time. Any other error code indicates that the overlapped operation was not successfully initiated and no completion indication will occur.</p>
<table>
<tbody><tr><th>Error code</th><th>Meaning</th></tr>
<tr><td>
<dl>
<dt><strong><a href="https://msdn.microsoft.com/en-us/library/windows/desktop/ms740668(v=vs.85).aspx#WSAECONNABORTED">WSAECONNABORTED</a></strong></dt>
</dl>
</td><td>
<p>The virtual circuit was terminated due to a time-out or other failure.</p>
</td></tr>
<tr><td>
<dl>
<dt><strong><a href="https://msdn.microsoft.com/en-us/library/windows/desktop/ms740668(v=vs.85).aspx#WSAECONNRESET">WSAECONNRESET</a></strong></dt>
</dl>
</td><td>
<p>For a stream socket, the virtual circuit was reset by the remote side. The application should close the socket as it is no longer usable. For a UDP datagram socket, this error would indicate that a previous send operation resulted in an ICMP "Port Unreachable" message.</p>
</td></tr>
<tr><td>
<dl>
<dt><strong><a href="https://msdn.microsoft.com/en-us/library/windows/desktop/ms740668(v=vs.85).aspx#WSAEDISCON">WSAEDISCON</a></strong></dt>
</dl>
</td><td>
<p>Socket <em>s</em> is message oriented and the virtual circuit was gracefully closed by the remote side.</p>
</td></tr>
<tr><td>
<dl>
<dt><strong><a href="https://msdn.microsoft.com/en-us/library/windows/desktop/ms740668(v=vs.85).aspx#WSAEFAULT">WSAEFAULT</a></strong></dt>
</dl>
</td><td>
<p>The <em>lpBuffers</em> parameter is not completely contained in a valid part of the user address space.</p>
</td></tr>
<tr><td>
<dl>
<dt><strong><a href="https://msdn.microsoft.com/en-us/library/windows/desktop/ms740668(v=vs.85).aspx#WSAEINPROGRESS">WSAEINPROGRESS</a></strong></dt>
</dl>
</td><td>
<p>A blocking Windows Sockets 1.1 call is in progress, or the service provider is still processing a callback function.</p>
</td></tr>
<tr><td>
<dl>
<dt><strong><a href="https://msdn.microsoft.com/en-us/library/windows/desktop/ms740668(v=vs.85).aspx#WSAEINTR">WSAEINTR</a></strong></dt>
</dl>
</td><td>
<p>The (blocking) call was canceled by the <a href="https://msdn.microsoft.com/en-us/library/windows/desktop/ms741547(v=vs.85).aspx">WSACancelBlockingCall</a> function.</p>
</td></tr>
<tr><td>
<dl>
<dt><strong><a href="https://msdn.microsoft.com/en-us/library/windows/desktop/ms740668(v=vs.85).aspx#WSAEINVAL">WSAEINVAL</a></strong></dt>
</dl>
</td><td>
<p>The socket has not been bound (for example, with
<a href="https://msdn.microsoft.com/en-us/library/windows/desktop/ms737550(v=vs.85).aspx"><strong xmlns="http://www.w3.org/1999/xhtml">bind</strong></a>).</p>
</td></tr>
<tr><td>
<dl>
<dt><strong><a href="https://msdn.microsoft.com/en-us/library/windows/desktop/ms740668(v=vs.85).aspx#WSAEMSGSIZE">WSAEMSGSIZE</a></strong></dt>
</dl>
</td><td>
<p>The message was too large to fit into the specified buffer and (for unreliable protocols only) any trailing portion of the message that did not fit into the buffer has been discarded.</p>
</td></tr>
<tr><td>
<dl>
<dt><strong><a href="https://msdn.microsoft.com/en-us/library/windows/desktop/ms740668(v=vs.85).aspx#WSAENETDOWN">WSAENETDOWN</a></strong></dt>
</dl>
</td><td>
<p>The network subsystem has failed.</p>
</td></tr>
<tr><td>
<dl>
<dt><strong><a href="https://msdn.microsoft.com/en-us/library/windows/desktop/ms740668(v=vs.85).aspx#WSAENETRESET">WSAENETRESET</a></strong></dt>
</dl>
</td><td>
<p>For a connection-oriented socket, this error indicates that the connection has been broken due to <em>keep-alive</em> activity that detected a failure while the operation was in progress. For a datagram socket, this error indicates that the time to live has expired.</p>
</td></tr>
<tr><td>
<dl>
<dt><strong><a href="https://msdn.microsoft.com/en-us/library/windows/desktop/ms740668(v=vs.85).aspx#WSAENOTCONN">WSAENOTCONN</a></strong></dt>
</dl>
</td><td>
<p>The socket is not connected.</p>
</td></tr>
<tr><td>
<dl>
<dt><strong><a href="https://msdn.microsoft.com/en-us/library/windows/desktop/ms740668(v=vs.85).aspx#WSAENOTSOCK">WSAENOTSOCK</a></strong></dt>
</dl>
</td><td>
<p>The descriptor is not a socket.</p>
</td></tr>
<tr><td>
<dl>
<dt><strong><a href="https://msdn.microsoft.com/en-us/library/windows/desktop/ms740668(v=vs.85).aspx#WSAEOPNOTSUPP">WSAEOPNOTSUPP</a></strong></dt>
</dl>
</td><td>
<p><strong>MSG_OOB</strong> was specified, but the socket is not stream-style such as type SOCK_STREAM, OOB data is not supported in the communication domain associated with this socket, or the socket is unidirectional and supports only send operations.</p>
</td></tr>
<tr><td>
<dl>
<dt><strong><a href="https://msdn.microsoft.com/en-us/library/windows/desktop/ms740668(v=vs.85).aspx#WSAESHUTDOWN">WSAESHUTDOWN</a></strong></dt>
</dl>
</td><td>
<p>The socket has been shut down; it is not possible to call
<a href="https://msdn.microsoft.com/en-us/library/windows/desktop/ms741688(v=vs.85).aspx"><strong xmlns="http://www.w3.org/1999/xhtml">WSARecv</strong></a> on a socket after
<a href="https://msdn.microsoft.com/en-us/library/windows/desktop/ms740481(v=vs.85).aspx"><strong xmlns="http://www.w3.org/1999/xhtml">shutdown</strong></a> has been invoked with <em>how</em> set to <strong>SD_RECEIVE</strong> or <strong>SD_BOTH</strong>.</p>
</td></tr>
<tr><td>
<dl>
<dt><strong><a href="https://msdn.microsoft.com/en-us/library/windows/desktop/ms740668(v=vs.85).aspx#WSAETIMEDOUT">WSAETIMEDOUT</a></strong></dt>
</dl>
</td><td>
<p>The connection has been dropped because of a network failure or because the peer system failed to respond.</p>
</td></tr>
<tr><td>
<dl>
<dt><strong><a href="https://msdn.microsoft.com/en-us/library/windows/desktop/ms740668(v=vs.85).aspx#WSAEWOULDBLOCK">WSAEWOULDBLOCK</a></strong></dt>
</dl>
</td><td>
<p>
</p><p><strong>Windows&nbsp;NT:&nbsp;&nbsp;</strong>Overlapped sockets: there are too many outstanding overlapped I/O requests. Nonoverlapped sockets: The socket is marked as nonblocking and the receive operation cannot be completed immediately.</p>
</td></tr>
<tr><td>
<dl>
<dt><strong><a href="https://msdn.microsoft.com/en-us/library/windows/desktop/ms740668(v=vs.85).aspx#WSANOTINITIALISED">WSANOTINITIALISED</a></strong></dt>
</dl>
</td><td>
<p>A successful
<a href="https://msdn.microsoft.com/en-us/library/windows/desktop/ms742213(v=vs.85).aspx"><strong xmlns="http://www.w3.org/1999/xhtml">WSAStartup</strong></a> call must occur before using this function.</p>
</td></tr>
<tr><td>
<dl>
<dt><strong><a href="https://msdn.microsoft.com/en-us/library/windows/desktop/ms740668(v=vs.85).aspx#WSA_IO_PENDING">WSA_IO_PENDING</a></strong></dt>
</dl>
</td><td>
<p>An overlapped operation was successfully initiated and completion will be indicated at a later time.</p>
</td></tr>
<tr><td>
<dl>
<dt><strong><a href="https://msdn.microsoft.com/en-us/library/windows/desktop/ms740668(v=vs.85).aspx#WSA_OPERATION_ABORTED">WSA_OPERATION_ABORTED</a></strong></dt>
</dl>
</td><td>
<p>The overlapped operation has been canceled due to the closure of the socket.</p>
</td></tr>
</tbody></table>
<p>&nbsp;</p>
<h2>Remarks</h2>
<p>The
<strong>WSARecv</strong> function provides some additional features compared with the standard
<a href="https://msdn.microsoft.com/en-us/library/windows/desktop/ms740121(v=vs.85).aspx"><strong xmlns="http://www.w3.org/1999/xhtml">recv</strong></a> function in three important areas:</p>
<ul>
<li>It can be used in conjunction with overlapped sockets to perform overlapped
<a href="https://msdn.microsoft.com/en-us/library/windows/desktop/ms740121(v=vs.85).aspx"><strong xmlns="http://www.w3.org/1999/xhtml">recv</strong></a> operations.</li>
<li>It allows multiple receive buffers to be specified making it applicable to the scatter/gather type of I/O.</li>
<li>The <em>lpFlags</em> parameter is used both on input and returned on output, allowing applications to sense the output state of the <strong>MSG_PARTIAL</strong> flag bit. However, the <strong>MSG_PARTIAL</strong> flag bit is not supported by all protocols.</li>
</ul>
<p>The
<strong>WSARecv</strong> function is used on connected sockets or bound connectionless sockets specified by the <em>s</em> parameter and is used to read incoming data. The socket's local address must be known. For server applications, this is usually done explicitly through
<a href="https://msdn.microsoft.com/en-us/library/windows/desktop/ms737550(v=vs.85).aspx"><strong xmlns="http://www.w3.org/1999/xhtml">bind</strong></a> or implicitly through
<a href="https://msdn.microsoft.com/en-us/library/windows/desktop/ms737526(v=vs.85).aspx"><strong xmlns="http://www.w3.org/1999/xhtml">accept</strong></a> or
<a href="https://msdn.microsoft.com/en-us/library/windows/desktop/ms741513(v=vs.85).aspx"><strong xmlns="http://www.w3.org/1999/xhtml">WSAAccept</strong></a>. Explicit binding is discouraged for client applications. For client applications the socket can become bound implicitly to a local address through
<a href="https://msdn.microsoft.com/en-us/library/windows/desktop/ms737625(v=vs.85).aspx"><strong xmlns="http://www.w3.org/1999/xhtml">connect</strong></a>,
<a href="https://msdn.microsoft.com/en-us/library/windows/desktop/ms741559(v=vs.85).aspx"><strong xmlns="http://www.w3.org/1999/xhtml">WSAConnect</strong></a>,
<a href="https://msdn.microsoft.com/en-us/library/windows/desktop/ms740148(v=vs.85).aspx"><strong xmlns="http://www.w3.org/1999/xhtml">sendto</strong></a>,
<a href="https://msdn.microsoft.com/en-us/library/windows/desktop/ms741693(v=vs.85).aspx"><strong xmlns="http://www.w3.org/1999/xhtml">WSASendTo</strong></a>, or
<a href="https://msdn.microsoft.com/en-us/library/windows/desktop/ms741628(v=vs.85).aspx"><strong xmlns="http://www.w3.org/1999/xhtml">WSAJoinLeaf</strong></a>.</p>
<p>For connected, connectionless sockets, this function restricts the addresses from which received messages are accepted. The function only returns messages from the remote address specified in the connection. Messages from other addresses are (silently) discarded.</p>
<p>For overlapped sockets,
<strong>WSARecv</strong> is used to post one or more buffers into which incoming data will be placed as it becomes available, after which the application-specified completion indication (invocation of the completion routine or setting of an event object) occurs. If the operation does not complete immediately, the final completion status is retrieved through the completion routine or
<a href="https://msdn.microsoft.com/en-us/library/windows/desktop/ms741582(v=vs.85).aspx"><strong xmlns="http://www.w3.org/1999/xhtml">WSAGetOverlappedResult</strong></a>.</p>
<p class="note"><strong>Note</strong>&nbsp;&nbsp;All I/O initiated by a given thread is canceled when that thread exits. For overlapped sockets, pending asynchronous operations can fail if the thread is closed before the operations complete. See <a href="https://msdn.microsoft.com/en-us/library/windows/desktop/ms682659(v=vs.85).aspx"><strong xmlns="http://www.w3.org/1999/xhtml">ExitThread</strong></a> for more information.</p>
<p>If both <em>lpOverlapped</em> and <em>lpCompletionRoutine</em> are <strong>NULL</strong>, the socket in this function will be treated as a nonoverlapped socket.</p>
<p>For nonoverlapped sockets, the blocking semantics are identical to that of the standard
<a href="https://msdn.microsoft.com/en-us/library/windows/desktop/ms740121(v=vs.85).aspx"><strong xmlns="http://www.w3.org/1999/xhtml">recv</strong></a> function and the <em>lpOverlapped</em> and <em>lpCompletionRoutine</em> parameters are ignored. Any data that has already been received and buffered by the transport will be copied into the specified user buffers. In the case of a blocking socket with no data currently having been received and buffered by the transport, the call will block until data is received. Windows Sockets 2 does not define any standard blocking time-out mechanism for this function. For protocols acting as byte-stream protocols the stack tries to return as much data as possible subject to the available buffer space and amount of received data available. However, receipt of a single byte is sufficient to unblock the caller. There is no guarantee that more than a single byte will be returned. For protocols acting as message-oriented, a full message is required to unblock the caller.</p>
<p class="note"><strong>Note</strong>&nbsp;&nbsp;The socket options <strong>SO_RCVTIMEO</strong> and <strong>SO_SNDTIMEO</strong> apply only to blocking sockets.</p>
<p>Whether or not a protocol is acting as byte stream is determined by the setting of XP1_MESSAGE_ORIENTED and XP1_PSEUDO_STREAM in its
<a href="https://msdn.microsoft.com/en-us/library/windows/desktop/ms741675(v=vs.85).aspx"><strong xmlns="http://www.w3.org/1999/xhtml">WSAPROTOCOL_INFO</strong></a> structure and the setting of the MSG_PARTIAL flag passed in to this function (for protocols that support it). The following table lists relevant combinations, (an asterisk (*) indicates that the setting of this bit does not matter in this case).</p>
<p>
</p><table>
<tbody><tr><th>XP1_MESSAGE_ORIENTED</th><th>XP1_PSEUDO_STREAM</th><th>MSG_PARTIAL</th><th>Acts as</th></tr>
<tr><td>not set</td><td>*</td><td>*</td><td>Byte stream</td></tr>
<tr><td>*</td><td>Set</td><td>*</td><td>Byte stream</td></tr>
<tr><td>set</td><td>Not set</td><td>set</td><td>Byte stream</td></tr>
<tr><td>set</td><td>Not set</td><td>not set</td><td>Message oriented</td></tr>
</tbody></table>
<p>&nbsp;</p>
<p>The buffers are filled in the order in which they appear in the array pointed to by <em>lpBuffers</em>, and the buffers are packed so that no holes are created.</p>
<p>If this function is completed in an overlapped manner, it is the Winsock service provider's responsibility to capture the
<a href="https://msdn.microsoft.com/en-us/library/windows/desktop/ms741542(v=vs.85).aspx"><strong xmlns="http://www.w3.org/1999/xhtml">WSABUF</strong></a> structures before returning from this call. This enables applications to build stack-based
<strong>WSABUF</strong> arrays pointed to by the <em>lpBuffers</em> parameter.</p>
<p>For byte stream-style sockets (for example, type <strong>SOCK_STREAM</strong>), incoming data is placed into the buffers until the buffers are filled, the connection is closed, or the internally buffered data is exhausted. Regardless of whether or not the incoming data fills all the buffers, the completion indication occurs for overlapped sockets.</p>
<p>For message-oriented sockets (for example, type <strong>SOCK_DGRAM</strong>), an incoming message is placed into the buffers up to the total size of the buffers, and the completion indication occurs for overlapped sockets. If the message is larger than the buffers, the buffers are filled with the first part of the message. If the <strong>MSG_PARTIAL</strong> feature is supported by the underlying service provider, the <strong>MSG_PARTIAL</strong> flag is set in <em>lpFlags</em> and subsequent receive operations will retrieve the rest of the message. If <strong>MSG_PARTIAL</strong> is not supported but the protocol is reliable,
<strong>WSARecv</strong> generates the error
<a href="https://msdn.microsoft.com/en-us/library/windows/desktop/ms740668(v=vs.85).aspx#WSAEMSGSIZE">WSAEMSGSIZE</a> and a subsequent receive operation with a larger buffer can be used to retrieve the entire message. Otherwise, (that is, the protocol is unreliable and does not support <strong>MSG_PARTIAL</strong>), the excess data is lost, and
<strong>WSARecv</strong> generates the error WSAEMSGSIZE.</p>
<p>For connection-oriented sockets,
<strong>WSARecv</strong> can indicate the graceful termination of the virtual circuit in one of two ways that depend on whether the socket is byte stream or message oriented. For byte streams, zero bytes having been read (as indicated by a zero return value to indicate success, and <em>lpNumberOfBytesRecvd</em> value of zero) indicates graceful closure and that no more bytes will ever be read. For message-oriented sockets, where a zero byte message is often allowable, a failure with an error code of
<a href="https://msdn.microsoft.com/en-us/library/windows/desktop/ms740668(v=vs.85).aspx#WSAEDISCON">WSAEDISCON</a> is used to indicate graceful closure. In any case a return error code of
<a href="https://msdn.microsoft.com/en-us/library/windows/desktop/ms740668(v=vs.85).aspx#WSAECONNRESET">WSAECONNRESET</a> indicates an abortive close has occurred.</p>
<p>The <em>lpFlags</em> parameter can be used to influence the behavior of the function invocation beyond the options specified for the associated socket. That is, the semantics of this function are determined by the socket options and the <em>lpFlags</em> parameter. The latter is constructed by using the bitwise OR operator with any of the values listed in the following table.</p>
<p>
</p><table>
<tbody><tr><th>Value</th><th>Meaning</th></tr>
<tr><td>MSG_PEEK</td><td>
<p>Peeks at the incoming data. The data is copied into the buffer, but is not removed from the input queue.</p>
<p>This flag is valid only for nonoverlapped sockets.</p>
</td></tr>
<tr><td>MSG_OOB</td><td>Processes OOB data.</td></tr>
<tr><td>MSG_PARTIAL</td><td>
<p>This flag is for message-oriented sockets only. On output, this flag indicates that the data specified is a portion of the message transmitted by the sender. Remaining portions of the message will be specified in subsequent receive operations. A subsequent receive operation with the <strong>MSG_PARTIAL</strong> flag cleared indicates end of sender's message.</p>
<p>As an input parameter, this flag indicates that the receive operation should complete even if only part of a message has been received by the transport provider.</p>
</td></tr>
<tr><td>MSG_PUSH_IMMEDIATE</td><td>
<p>This flag is for stream-oriented sockets only. This flag allows an application that uses stream sockets to tell the transport provider not to delay completion of partially filled pending receive requests. This is a hint to the transport provider that the application is willing to receive any incoming data as soon as possible without necessarily waiting for the remainder of the data that might still be in transit. What constitutes a partially filled pending receive request is a transport-specific matter. </p>
<p>In the case of TCP, this refers to the case of incoming TCP segments being placed into the receive request data buffer where none of the TCP segments indicated a PUSH bit value of 1. In this case, TCP may hold the partially filled receive request a little longer to allow the remainder of the data to arrive with a TCP segment that has the PUSH bit set to 1. This flag tells TCP not to hold the receive request but to complete it immediately.</p>
<p> Using this flag for large block transfers is not recommended since processing partial blocks is often not optimal. This flag is useful only for cases where receiving and processing the partial data immediately helps decrease processing latency.</p>
<p>This flag is a hint rather than an actual guarantee.</p>
<p>This flag is supported on Windows&nbsp;8.1, Windows Server&nbsp;2012&nbsp;R2, and later.</p>
</td></tr>
<tr><td>MSG_WAITALL</td><td>
<p>The receive request will complete only when one of the following events occurs:</p><ul>
<li>The buffer supplied by the caller is completely full.</li>
<li>The connection has been closed.</li>
<li>The request has been canceled or an error occurred.</li>
</ul>
<p>Be aware that if the underlying transport provider does not support <strong>MSG_WAITALL</strong>, or if the socket is in a non-blocking mode, then this call will fail with <strong>WSAEOPNOTSUPP</strong>. Also, if <strong>MSG_WAITALL</strong> is specified along with <strong>MSG_OOB</strong>, <strong>MSG_PEEK</strong>, or <strong>MSG_PARTIAL</strong>, then this call will fail with <strong>WSAEOPNOTSUPP</strong>.</p>
<p>This flag is not supported on datagram sockets or message-oriented sockets.</p>
</td></tr>
</tbody></table>
<p>&nbsp;</p>
<p>For message-oriented sockets, the <strong>MSG_PARTIAL</strong> bit is set in the <em>lpFlags</em> parameter if a partial message is received. If a complete message is received, <strong>MSG_PARTIAL</strong> is cleared in <em>lpFlags</em>. In the case of delayed completion, the value pointed to by <em>lpFlags</em> is not updated. When completion has been indicated, the application should call
<a href="https://msdn.microsoft.com/en-us/library/windows/desktop/ms741582(v=vs.85).aspx"><strong xmlns="http://www.w3.org/1999/xhtml">WSAGetOverlappedResult</strong></a> and examine the flags indicated by the <em>lpdwFlags</em> parameter.</p>
<p class="note"><strong>Note</strong>&nbsp;&nbsp;When issuing a blocking Winsock call such as <strong>WSARecv</strong> with the <em>lpOverlapped</em> parameter set to NULL, Winsock may need to wait for a network event before the call can complete. Winsock performs an alertable wait in this situation, which can be interrupted by an asynchronous procedure call (APC) scheduled on the same thread. Issuing another blocking Winsock call inside an APC that interrupted an ongoing blocking Winsock call on the same thread will lead to undefined behavior, and must never be attempted by Winsock clients. </p>
<h3><a id="Overlapped_Socket_I_O"></a><a id="overlapped_socket_i_o"></a><a id="OVERLAPPED_SOCKET_I_O"></a>Overlapped Socket I/O</h3>
<p>If an overlapped operation completes immediately,
<strong>WSARecv</strong> returns a value of zero and the <em>lpNumberOfBytesRecvd</em> parameter is updated with the number of bytes received and the flag bits indicated by the <em>lpFlags</em> parameter are also updated. If the overlapped operation is successfully initiated and will complete later,
<strong>WSARecv</strong> returns <strong>SOCKET_ERROR</strong> and indicates error code
<a href="https://msdn.microsoft.com/en-us/library/windows/desktop/ms740668(v=vs.85).aspx#WSA_IO_PENDING">WSA_IO_PENDING</a>. In this case, <em>lpNumberOfBytesRecvd</em> and <em>lpFlags</em> are not updated. When the overlapped operation completes, the amount of data transferred is indicated either through the <em>cbTransferred</em> parameter in the completion routine (if specified), or through the <em>lpcbTransfer</em> parameter in
<a href="https://msdn.microsoft.com/en-us/library/windows/desktop/ms741582(v=vs.85).aspx"><strong xmlns="http://www.w3.org/1999/xhtml">WSAGetOverlappedResult</strong></a>. Flag values are obtained by examining the <em>lpdwFlags</em> parameter of
<strong>WSAGetOverlappedResult</strong>.</p>
<p>The
<strong>WSARecv</strong> function using overlapped I/O can be called from within the completion routine of a previous
<strong>WSARecv</strong>,
<a href="https://msdn.microsoft.com/en-us/library/windows/desktop/ms741686(v=vs.85).aspx"><strong xmlns="http://www.w3.org/1999/xhtml">WSARecvFrom</strong></a>,
<a href="https://msdn.microsoft.com/en-us/library/windows/desktop/ms742203(v=vs.85).aspx"><strong xmlns="http://www.w3.org/1999/xhtml">WSASend</strong></a> or
<a href="https://msdn.microsoft.com/en-us/library/windows/desktop/ms741693(v=vs.85).aspx"><strong xmlns="http://www.w3.org/1999/xhtml">WSASendTo</strong></a> function. For a given socket, I/O completion routines will not be nested. This permits time-sensitive data transmissions to occur entirely within a preemptive context.</p>
<p>The <em>lpOverlapped</em> parameter must be valid for the duration of the overlapped operation. If multiple I/O operations are simultaneously outstanding, each must reference a separate
<a href="https://msdn.microsoft.com/en-us/library/windows/desktop/ms741665(v=vs.85).aspx"><strong xmlns="http://www.w3.org/1999/xhtml">WSAOVERLAPPED</strong></a> structure.</p>
<p>If the <em>lpCompletionRoutine</em> parameter is <strong>NULL</strong>, the <em>hEvent</em> parameter of <em>lpOverlapped</em> is signaled when the overlapped operation completes if it contains a valid event object handle. An application can use
<a href="https://msdn.microsoft.com/en-us/library/windows/desktop/ms742219(v=vs.85).aspx"><strong xmlns="http://www.w3.org/1999/xhtml">WSAWaitForMultipleEvents</strong></a> or
<a href="https://msdn.microsoft.com/en-us/library/windows/desktop/ms741582(v=vs.85).aspx"><strong xmlns="http://www.w3.org/1999/xhtml">WSAGetOverlappedResult</strong></a> to wait or poll on the event object.</p>
<p>If <em>lpCompletionRoutine</em> is not <strong>NULL</strong>, the <em>hEvent</em> parameter is ignored and can be used by the application to pass context information to the completion routine. A caller that passes a non-<strong>NULL</strong> <em>lpCompletionRoutine</em> and later calls
<a href="https://msdn.microsoft.com/en-us/library/windows/desktop/ms741582(v=vs.85).aspx"><strong xmlns="http://www.w3.org/1999/xhtml">WSAGetOverlappedResult</strong></a> for the same overlapped I/O request may not set the <em>fWait</em> parameter for that invocation of
<strong>WSAGetOverlappedResult</strong> to <strong>TRUE</strong>. In this case the usage of the <em>hEvent</em> parameter is undefined, and attempting to wait on the <em>hEvent</em> parameter would produce unpredictable results.</p>
<p>The completion routine follows the same rules as stipulated for Windows file I/O completion routines. The completion routine will not be invoked until the thread is in an alertable wait state such as can occur when the function
<a href="https://msdn.microsoft.com/en-us/library/windows/desktop/ms742219(v=vs.85).aspx"><strong xmlns="http://www.w3.org/1999/xhtml">WSAWaitForMultipleEvents</strong></a> with the <em>fAlertable</em> parameter set to <strong>TRUE</strong> is invoked.</p>
<p>The prototype of the completion routine is as follows:</p>
<div id="code-snippet-2" class="codeSnippetContainer" xmlns="">
<div class="codeSnippetContainerTabs">
<div class="codeSnippetContainerTabSingle" dir="ltr"><a>C++</a></div>
</div>
<div class="codeSnippetContainerCodeContainer">
<div class="codeSnippetToolBar">
<div class="codeSnippetToolBarText">
<a name="CodeSnippetCopyLink" style="display: none;" title="Copy to clipboard." href="javascript:if (window.epx.codeSnippet)window.epx.codeSnippet.copyCode('CodeSnippetContainerCode_a0414305-023f-4c45-b7fa-9d2fb0645dd7');">Copy</a>
</div>
</div>
<div id="CodeSnippetContainerCode_a0414305-023f-4c45-b7fa-9d2fb0645dd7" class="codeSnippetContainerCode" dir="ltr">
<div style="color:Black;"><pre>
<span style="color:Blue;">void</span> CALLBACK CompletionROUTINE(
IN DWORD dwError,
IN DWORD cbTransferred,
IN LPWSAOVERLAPPED lpOverlapped,
IN DWORD dwFlags
);
</pre></div>
</div>
</div>
</div>
<p>CompletionRoutine is a placeholder for an application-defined or library-defined function name. The <em>dwError</em> specifies the completion status for the overlapped operation as indicated by <em>lpOverlapped</em>. The <em>cbTransferred</em> parameter specifies the number of bytes received. The <em>dwFlags</em> parameter contains information that would have appeared in <em>lpFlags</em> if the receive operation had completed immediately. This function does not return a value.</p>
<p>Returning from this function allows invocation of another pending completion routine for this socket. When using
<a href="https://msdn.microsoft.com/en-us/library/windows/desktop/ms742219(v=vs.85).aspx"><strong xmlns="http://www.w3.org/1999/xhtml">WSAWaitForMultipleEvents</strong></a>, all waiting completion routines are called before the alertable thread's wait is satisfied with a return code of <strong>WSA_IO_COMPLETION</strong>. The completion routines can be called in any order, not necessarily in the same order the overlapped operations are completed. However, the posted buffers are guaranteed to be filled in the same order in which they are specified.</p>
<p>If you are using I/O completion ports, be aware that the order of calls made to <strong>WSARecv</strong> is also the order in which the buffers are populated. <strong>WSARecv</strong> should not be called on the same socket simultaneously from different threads, because it can result in an unpredictable buffer order.</p>
<h3><a id="Example_Code"></a><a id="example_code"></a><a id="EXAMPLE_CODE"></a>Example Code</h3>
<p>The following example shows how to use the <strong>WSARecv</strong> function in overlapped I/O mode.</p>
<div id="code-snippet-3" class="codeSnippetContainer" xmlns="">
<div class="codeSnippetContainerTabs">
<div class="codeSnippetContainerTabSingle" dir="ltr"><a>C++</a></div>
</div>
<div class="codeSnippetContainerCodeContainer">
<div class="codeSnippetToolBar">
<div class="codeSnippetToolBarText">
<a name="CodeSnippetCopyLink" style="display: none;" title="Copy to clipboard." href="javascript:if (window.epx.codeSnippet)window.epx.codeSnippet.copyCode('CodeSnippetContainerCode_f1cafd4c-b1a2-4b97-ac42-d0961fd0071d');">Copy</a>
</div>
</div>
<div id="CodeSnippetContainerCode_f1cafd4c-b1a2-4b97-ac42-d0961fd0071d" class="codeSnippetContainerCode" dir="ltr">
<div style="color:Black;"><pre>
#ifndef UNICODE
#define UNICODE
#endif
#ifndef WIN32_LEAN_AND_MEAN
#define WIN32_LEAN_AND_MEAN
#endif
#include &lt;Windows.h&gt;
#include &lt;winsock2.h&gt;
#include &lt;ws2tcpip.h&gt;
#include &lt;stdio.h&gt;
#include &lt;stdlib.h&gt;
<span style="color:Green;">// Need to link with Ws2_32.lib</span>
#pragma comment(lib, <span style="color:#A31515;">"ws2_32.lib"</span>)
#pragma warning(disable: 4127) <span style="color:Green;">// Conditional expression is a constant</span>
#define DATA_BUFSIZE 4096
<span style="color:Blue;">int</span> __cdecl main(<span style="color:Blue;">int</span> argc, <span style="color:Blue;">char</span> **argv)
{
WSADATA wsd;
<span style="color:Blue;">struct</span> addrinfo *result = NULL, *ptr = NULL, hints;
WSAOVERLAPPED RecvOverlapped;
SOCKET ConnSocket = INVALID_SOCKET;
WSABUF DataBuf;
DWORD RecvBytes, Flags;
<span style="color:Blue;">char</span> buffer[DATA_BUFSIZE];
<span style="color:Blue;">int</span> err = 0;
<span style="color:Blue;">int</span> rc;
<span style="color:Blue;">if</span> (argc != 2) {
wprintf(L<span style="color:#A31515;">"usage: %s server-name\n"</span>, argv[0]);
<span style="color:Blue;">return</span> 1;
}
<span style="color:Green;">// Load Winsock</span>
rc = WSAStartup(MAKEWORD(2, 2), &amp;wsd);
<span style="color:Blue;">if</span> (rc != 0) {
wprintf(L<span style="color:#A31515;">"Unable to load Winsock: %d\n"</span>, rc);
<span style="color:Blue;">return</span> 1;
}
<span style="color:Green;">// Make sure the hints struct is zeroed out</span>
SecureZeroMemory((PVOID) &amp; hints, <span style="color:Blue;">sizeof</span> (<span style="color:Blue;">struct</span> addrinfo));
<span style="color:Green;">// Initialize the hints to retrieve the server address for IPv4</span>
hints.ai_family = AF_INET;
hints.ai_socktype = SOCK_STREAM;
hints.ai_protocol = IPPROTO_TCP;
rc = getaddrinfo(argv[1], <span style="color:#A31515;">"27015"</span>, &amp;hints, &amp;result);
<span style="color:Blue;">if</span> (rc != 0) {
wprintf(L<span style="color:#A31515;">"getaddrinfo failed with error: %d\n"</span>, rc);
<span style="color:Blue;">return</span> 1;
}
<span style="color:Blue;">for</span> (ptr = result; ptr != NULL; ptr = ptr-&gt;ai_next) {
ConnSocket = socket(ptr-&gt;ai_family, ptr-&gt;ai_socktype, ptr-&gt;ai_protocol);
<span style="color:Blue;">if</span> (ConnSocket == INVALID_SOCKET) {
wprintf(L<span style="color:#A31515;">"socket failed with error: %d\n"</span>, WSAGetLastError());
freeaddrinfo(result);
<span style="color:Blue;">return</span> 1;
}
rc = connect(ConnSocket, ptr-&gt;ai_addr, (<span style="color:Blue;">int</span>) ptr-&gt;ai_addrlen);
<span style="color:Blue;">if</span> (rc == SOCKET_ERROR) {
<span style="color:Blue;">if</span> (WSAECONNREFUSED == (err = WSAGetLastError())) {
closesocket(ConnSocket);
ConnSocket = INVALID_SOCKET;
<span style="color:Blue;">continue</span>;
}
wprintf(L<span style="color:#A31515;">"connect failed with error: %d\n"</span>, err);
freeaddrinfo(result);
closesocket(ConnSocket);
<span style="color:Blue;">return</span> 1;
}
<span style="color:Blue;">break</span>;
}
<span style="color:Blue;">if</span> (ConnSocket == INVALID_SOCKET) {
wprintf(L<span style="color:#A31515;">"Unable to establish connection with the server!\n"</span>);
freeaddrinfo(result);
<span style="color:Blue;">return</span> 1;
}
wprintf(L<span style="color:#A31515;">"Client connected...\n"</span>);
<span style="color:Green;">// Make sure the RecvOverlapped struct is zeroed out</span>
SecureZeroMemory((PVOID) &amp; RecvOverlapped, <span style="color:Blue;">sizeof</span> (WSAOVERLAPPED));
<span style="color:Green;">// Create an event handle and setup an overlapped structure.</span>
RecvOverlapped.hEvent = WSACreateEvent();
<span style="color:Blue;">if</span> (RecvOverlapped.hEvent == NULL) {
wprintf(L<span style="color:#A31515;">"WSACreateEvent failed: %d\n"</span>, WSAGetLastError());
freeaddrinfo(result);
closesocket(ConnSocket);
<span style="color:Blue;">return</span> 1;
}
DataBuf.len = DATA_BUFSIZE;
DataBuf.buf = buffer;
<span style="color:Green;">// Call WSARecv until the peer closes the connection</span>
<span style="color:Green;">// or until an error occurs</span>
<span style="color:Blue;">while</span> (1) {
Flags = 0;
rc = WSARecv(ConnSocket, &amp;DataBuf, 1, &amp;RecvBytes, &amp;Flags, &amp;RecvOverlapped, NULL);
<span style="color:Blue;">if</span> ((rc == SOCKET_ERROR) &amp;&amp; (WSA_IO_PENDING != (err = WSAGetLastError()))) {
wprintf(L<span style="color:#A31515;">"WSARecv failed with error: %d\n"</span>, err);
<span style="color:Blue;">break</span>;
}
rc = WSAWaitForMultipleEvents(1, &amp;RecvOverlapped.hEvent, TRUE, INFINITE, TRUE);
<span style="color:Blue;">if</span> (rc == WSA_WAIT_FAILED) {
wprintf(L<span style="color:#A31515;">"WSAWaitForMultipleEvents failed with error: %d\n"</span>, WSAGetLastError());
<span style="color:Blue;">break</span>;
}
rc = WSAGetOverlappedResult(ConnSocket, &amp;RecvOverlapped, &amp;RecvBytes, FALSE, &amp;Flags);
<span style="color:Blue;">if</span> (rc == FALSE) {
wprintf(L<span style="color:#A31515;">"WSARecv operation failed with error: %d\n"</span>, WSAGetLastError());
<span style="color:Blue;">break</span>;
}
wprintf(L<span style="color:#A31515;">"Read %d bytes\n"</span>, RecvBytes);
WSAResetEvent(RecvOverlapped.hEvent);
<span style="color:Green;">// If 0 bytes are received, the connection was closed</span>
<span style="color:Blue;">if</span> (RecvBytes == 0)
<span style="color:Blue;">break</span>;
}
WSACloseEvent(RecvOverlapped.hEvent);
closesocket(ConnSocket);
freeaddrinfo(result);
WSACleanup();
<span style="color:Blue;">return</span> 0;
}
</pre></div>
</div>
</div>
</div>
<p><strong>Windows&nbsp;Phone&nbsp;8:</strong> This function is supported for Windows Phone Store apps on Windows&nbsp;Phone&nbsp;8 and later.</p>
<p><strong>Windows&nbsp;8.1</strong> and <strong>Windows Server&nbsp;2012&nbsp;R2</strong>: This function is supported for Windows Store apps on Windows&nbsp;8.1, Windows Server&nbsp;2012&nbsp;R2, and later.</p>
<h2>Requirements</h2>
<table>
<tbody><tr><th>
<p>Minimum supported client</p>
</th><td>Windows&nbsp;8.1, Windows&nbsp;Vista [desktop apps only]</td></tr>
<tr><th>
<p>Minimum supported server</p>
</th><td>Windows Server&nbsp;2003 [desktop apps only]</td></tr>
<tr><th>
<p>Minimum supported phone</p>
</th><td>Windows Phone 8</td></tr>
<tr><th>
<p>Header</p>
</th><td>
<dl>
<dt>Winsock2.h</dt>
</dl>
</td></tr>
<tr><th>
<p>Library</p>
</th><td>
<dl>
<dt>Ws2_32.lib</dt>
</dl>
</td></tr>
<tr><th>
<p>DLL</p>
</th><td>
<dl>
<dt>Ws2_32.dll</dt>
</dl>
</td></tr>
</tbody></table>
<h2><a id="see_also"></a>See also</h2>
<dl>
<dt>
<a href="https://msdn.microsoft.com/en-us/library/windows/desktop/ms741416(v=vs.85).aspx">Winsock Reference</a>
</dt>
<dt>
<a href="https://msdn.microsoft.com/en-us/library/windows/desktop/ms741394(v=vs.85).aspx">Winsock Functions</a>
</dt>
<dt>
<a href="https://msdn.microsoft.com/en-us/library/windows/desktop/ms740121(v=vs.85).aspx"><strong xmlns="http://www.w3.org/1999/xhtml">recv</strong></a>
</dt>
<dt>
<a href="https://msdn.microsoft.com/en-us/library/windows/desktop/ms741551(v=vs.85).aspx"><strong xmlns="http://www.w3.org/1999/xhtml">WSACloseEvent</strong></a>
</dt>
<dt>
<a href="https://msdn.microsoft.com/en-us/library/windows/desktop/ms741561(v=vs.85).aspx"><strong xmlns="http://www.w3.org/1999/xhtml">WSACreateEvent</strong></a>
</dt>
<dt>
<a href="https://msdn.microsoft.com/en-us/library/windows/desktop/ms741542(v=vs.85).aspx"><strong xmlns="http://www.w3.org/1999/xhtml">WSABUF</strong></a>
</dt>
<dt>
<a href="https://msdn.microsoft.com/en-us/library/windows/desktop/ms741582(v=vs.85).aspx"><strong xmlns="http://www.w3.org/1999/xhtml">WSAGetOverlappedResult</strong></a>
</dt>
<dt>
<a href="https://msdn.microsoft.com/en-us/library/windows/desktop/ms741665(v=vs.85).aspx"><strong xmlns="http://www.w3.org/1999/xhtml">WSAOVERLAPPED</strong></a>
</dt>
<dt>
<a href="https://msdn.microsoft.com/en-us/library/windows/desktop/ms742212(v=vs.85).aspx"><strong xmlns="http://www.w3.org/1999/xhtml">WSASocket</strong></a>
</dt>
<dt>
<a href="https://msdn.microsoft.com/en-us/library/windows/desktop/ms742219(v=vs.85).aspx"><strong xmlns="http://www.w3.org/1999/xhtml">WSAWaitForMultipleEvents</strong></a>
</dt>
</dl>
<p>&nbsp;</p>
<p>&nbsp;</p>
</div>
</div>
<script id="CommentTemplate" type="text/x-jquery-tmpl">
<div class="communityContentAnnotation">
<a name="${Index}"></a>
<h3>
${Title}
</h3>
<div class="communityContentAnnotationBody">
{{html Body}}
</div>
<div class="communityContentAnnotationInfo">
<div class="communityContentAnnotationAvatarContainer">
<a href="${UserAvatar.Href}" title="${UserAvatar.ToolTip}" class="communityContentAnnotationAvatar"><img src="${UserAvatar.ImageUrl}" alt="${UserAvatar.ImageAltText}" width="34" height="34" /></a>
</div>
<div class="communityContentAnnotationUserDateContainer">
<div class="communityContentAnnotationUserContainer">
<a href="${UserAvatar.Href}">
${User}
</a>
</div>
<div class="communityContentAnnotationDateContainer">
<span>${Date}</span>
{{if EditLink}}
<span>
<a href="${EditLink.Href}" title="${EditLink.ToolTip}" class="communityContentCommentEditLink">${EditLink.Title}</a>
</span>
{{/if}}
{{if DeleteLink}}
<span>
<a href="${DeleteLink.Href}" title="${DeleteLink.ToolTip}" class="communityContentDeleteLink">${DeleteLink.Title}</a>
</span>
{{/if}}
</div>
</div>
</div>
</div>
</script>
<div class="communityContentContainer">
<div id="CommunityContentHeader" class="communityContentHeader">
<div class="communityContentHeaderTitleContainer">
<h2>Community Additions</h2>
<a class="communityContentAddLink" href="https://msdn.microsoft.com/en-us/library/windows/desktop/community/add/ms741688(v=vs.85).aspx">
<span class="communityContentAddButton" title="Add">
ADD
</span>
</a>
</div>
<div style="clear: both;"></div>
</div>
<div id="CommunityComments" data-url="/en-us/library/windows/desktop/community/comments/ms741688(v=vs.85).aspx"><div class="communityContentAnnotation"> <a name="5"></a> <h3> Problem on Windows Server 2003 SP2 </h3> <div class="communityContentAnnotationBody"> <p><br> <em>lpNumberOfBytesRecvd</em><br></p><br><p><br> <em>...</em><br></p><br><p><br> <span>Use&nbsp;</span><br> <strong>NULL</strong><br> <span>&nbsp;for this parameter if the&nbsp;</span><br> <em>lpOverlapped</em><br> <span>&nbsp;parameter is not&nbsp;</span><br> <strong>NULL</strong><br> <span>&nbsp;to avoid potentially erroneous results</span><br></p><br><p><br> <span>is BAD advice.</span><br></p><br><p><br> <span>If call WSARecv and pass NULL as </span><br> <em>lpNumberOfBytesRecvd</em><br> <span>&nbsp;and &nbsp;not-NULL&nbsp;</span><br> <span>lpOverlapped, then your application will generate a bunch of these:</span><br></p><br><p>Access violation - code c0000005 (first chance)</p><br><p>and if you try to attach to process by WinDbg and push command .g (Go) then application won't restore execution after this exception raising.</p><br><p>"!analyze -v" output parts:</p>FAULTING_IP:&nbsp;<br>mswsock+24a4<br>71b224a4 8901 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;mov &nbsp; &nbsp; dword ptr [ecx],eax<br><br>EXCEPTION_RECORD: &nbsp;ffffffff -- (.exr 0xffffffffffffffff)<br>ExceptionAddress: 71b224a4 (mswsock+0x000024a4)<br>&nbsp; &nbsp;ExceptionCode: c0000005 (Access violation)<br>&nbsp; ExceptionFlags: 00000000<br>NumberParameters: 2<br>&nbsp; &nbsp;Parameter[0]: 00000001<br>&nbsp; &nbsp;Parameter[1]: 00000000<br>Attempt to write to address 00000000<br><br>MODULE_NAME: mswsock<br><br>FAULTING_MODULE: 7c800000 ntdll<br><br>DEBUG_FLR_IMAGE_TIMESTAMP: &nbsp;485bf4c7<br><br>ERROR_CODE: (NTSTATUS) 0xc0000005 - The instruction at "0x%08lx" referenced memory at "0x%08lx". The memory could not be "%s".<br><br>EXCEPTION_CODE: (NTSTATUS) 0xc0000005 - The instruction at "0x%08lx" referenced memory at "0x%08lx". The memory could not be "%s".<br><br>EXCEPTION_PARAMETER1: &nbsp;00000001<br><br>EXCEPTION_PARAMETER2: &nbsp;00000000<br><br>WRITE_ADDRESS: &nbsp;00000000&nbsp;<br><br>FOLLOWUP_IP:&nbsp;<br>mswsock+24a4<br>71b224a4 8901 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;mov &nbsp; &nbsp; dword ptr [ecx],eax<br><br>MOD_LIST: &lt;ANALYSIS/&gt;<br><br>BUGCHECK_STR: &nbsp;APPLICATION_FAULT_NULL_POINTER_READ_NULL_POINTER_WRITE_WRONG_SYMBOLS<br><br>PRIMARY_PROBLEM_CLASS: &nbsp;NULL_POINTER_READ<br><br>DEFAULT_BUCKET_ID: &nbsp;NULL_POINTER_READ<br><br>LAST_CONTROL_TRANSFER: &nbsp;from 71c094e5 to 71b224a4<p><br></p> </div> <div class="communityContentAnnotationInfo"> <div class="communityContentAnnotationAvatarContainer"> <a href="https://social.msdn.microsoft.com/profile/ivan%20efimov/" title="" class="communityContentAnnotationAvatar"><img src="./WSARecv function (Windows)_files/avatar.jpg" alt="" width="34" height="34"></a> </div> <div class="communityContentAnnotationUserDateContainer"> <div class="communityContentAnnotationUserContainer"> <a href="https://social.msdn.microsoft.com/profile/ivan%20efimov/"> Ivan Efimov </a> </div> <div class="communityContentAnnotationDateContainer"> <span>3/12/2013</span> </div> </div> </div> </div><div class="communityContentAnnotation"> <a name="4"></a> <h3> Bad logics </h3> <div class="communityContentAnnotationBody"> Documentation is awful and incoherent to understand, which must reflect how much you suck to design semantics of WSARecv&nbsp;cooperative with overlapped I/O. Please make yourselves fully understand and redesign APIs of WSA with regard to overlapped I/O before release for the sake of mental health of your customers. Thank you VERY MUCH! </div> <div class="communityContentAnnotationInfo"> <div class="communityContentAnnotationAvatarContainer"> <a href="https://social.msdn.microsoft.com/profile/yang.dk/" title="" class="communityContentAnnotationAvatar"><img src="./WSARecv function (Windows)_files/avatar(1).jpg" alt="" width="34" height="34"></a> </div> <div class="communityContentAnnotationUserDateContainer"> <div class="communityContentAnnotationUserContainer"> <a href="https://social.msdn.microsoft.com/profile/yang.dk/"> Yang.DK </a> </div> <div class="communityContentAnnotationDateContainer"> <span>7/21/2012</span> </div> </div> </div> </div><div class="communityContentAnnotation"> <a name="2"></a> <h3> Callback on Return 0 </h3> <div class="communityContentAnnotationBody"> I have observed that when WSARecv returns zero, the callback, if given, is called before return from WSARecv function. Is this expected behavior? <br> </div> <div class="communityContentAnnotationInfo"> <div class="communityContentAnnotationAvatarContainer"> <a href="https://social.msdn.microsoft.com/profile/satindersingh/" title="" class="communityContentAnnotationAvatar"><img src="./WSARecv function (Windows)_files/avatar(2).jpg" alt="" width="34" height="34"></a> </div> <div class="communityContentAnnotationUserDateContainer"> <div class="communityContentAnnotationUserContainer"> <a href="https://social.msdn.microsoft.com/profile/satindersingh/"> SatinderSingh </a> </div> <div class="communityContentAnnotationDateContainer"> <span>4/3/2009</span> </div> </div> </div> </div><div class="communityContentAnnotation"> <a name="1"></a> <h3> WSAEFAULT </h3> <div class="communityContentAnnotationBody"> <p>The Error code section of the documentation for WSARecv is incomplete. WSAEFAULT can occur if lpFlags is NULL, or if lpNumberOfBytesRecvd is NULL when lpOverlapped is NULL.</p><br><p>Also, the Parameters section for lpBuffers could mention that it is safe to point lpBuffers to a transient area of memory, such as the stack. Although this is stated in the Remarks section, a repetition would help clear some confusion for users.</p> </div> <div class="communityContentAnnotationInfo"> <div class="communityContentAnnotationAvatarContainer"> <a href="https://social.msdn.microsoft.com/profile/joey_l/" title="" class="communityContentAnnotationAvatar"><img src="./WSARecv function (Windows)_files/avatar(3).jpg" alt="" width="34" height="34"></a> </div> <div class="communityContentAnnotationUserDateContainer"> <div class="communityContentAnnotationUserContainer"> <a href="https://social.msdn.microsoft.com/profile/joey_l/"> joey_l </a> </div> <div class="communityContentAnnotationDateContainer"> <span>4/9/2008</span> </div> </div> </div> </div></div>
</div>
<div class="libraryMemberFilter">
<div class="filterContainer">
<span>Show:</span>
<label>
<input type="checkbox" class="libraryFilterInherited" checked="checked" value="Inherit">Inherited
</label>
<label>
<input type="checkbox" class="libraryFilterProtected" checked="checked" value="Protected">Protected
</label>
</div>
</div>
<input type="hidden" id="libraryMemberFilterEmptyWarning" value="There are no members available with your current filter settings.">
</div>
</div>
<div class="clear"></div>
<input name="__RequestVerificationToken" type="hidden" value="iiy4PVjXBoY-N8xVnX6kuot8UVfoqFtaNvFIKY2JTPRPvHgsFIB8IPsCZgePzUKuXZYvZkYKi-lS_cKUhLJdaUAW7_I1">
<input id="ratingSubmitUrl" type="hidden" value="https://msdn.microsoft.com/en-us/library/feedback/add/ms741688(v=vs.85).aspx">
<input id="isTopicRated" type="hidden" value="false">
<div id="ux-footer" class="ltr">
<div id="footerSock">
<div id="footerSockInner">
<a name="feedback"></a>
<div data-fragmentname="Survey" id="Fragment_Survey" xmlns="http://www.w3.org/1999/xhtml"></div>
<div class="rating" style="display: block;">
<div id="ratingSection1">
<div class="title">
Was this page helpful?
</div>
<div class="description">
Your feedback about this content is important.<br>Let us know what you think.
</div>
<div class="buttons">
<button class="button" id="ratingYes">Yes</button>
<button class="button" id="ratingNo">No</button>
</div>
<input id="ratingValue" type="hidden" value="">
</div>
<div id="ratingSection2">
<div class="title">
Additional feedback?
</div>
<textarea id="ratingText" rows="6" cols="" maxlength="1500"></textarea>
<div class="counter right">
<span id="feedbackTextCounter">1500</span> characters remaining
</div>
<div class="buttons left">
<button class="button" id="ratingSubmit">Submit</button>
<button class="button" id="ratingSkipThis">Skip this</button>
</div>
</div>
<div id="ratingSection3">
<div class="title">
Thank you!
</div>
<div class="description">
We appreciate your feedback.
</div>
</div>
<div id="contentFeedbackQAContainer" style="display: none;"></div>
</div>
<div data-fragmentname="SockLinks" id="Fragment_SockLinks" xmlns="http://www.w3.org/1999/xhtml">
<div class="linkList">
<ul class="links">
<li>
<a href="http://go.microsoft.com/fwlink/p/?LinkId=317809" id="SockLinks_726_11" xmlns="http://www.w3.org/1999/xhtml">Find us on Facebook</a>
</li>
<li>
<a href="http://go.microsoft.com/fwlink/p/?LinkId=317811" id="SockLinks_726_12" xmlns="http://www.w3.org/1999/xhtml">Follow us on Twitter</a>
</li>
<li>
<a href="http://go.microsoft.com/fwlink/p/?linkid=393788" id="SockLinks_726_42" xmlns="http://www.w3.org/1999/xhtml">Read the blog</a>
</li>
</ul>
</div>
</div>
<div class="clear"></div>
</div>
</div>
<div id="footerContainer">
<div id="fourColumnFooter">
<div data-fragmentname="Column1" id="Fragment_Column1" xmlns="http://www.w3.org/1999/xhtml">
<div class="ListOfLinkLists">
<div class="listItems">
<div class="linkList" xmlns="http://www.w3.org/1999/xhtml">
<div class="linkListTitle">Centers</div>
<ul class="links">
<li>
<a href="http://dev.windows.com/" id="Column1_726_13" xmlns="http://www.w3.org/1999/xhtml">Windows Dev Center</a>
</li>
<li>
<a href="http://msdn.microsoft.com/windows/desktop" id="Column1_726_16" xmlns="http://www.w3.org/1999/xhtml">Desktop</a>
</li>
<li>
<a href="http://msdn.microsoft.com/windows/hardware" id="Column1_726_17" xmlns="http://www.w3.org/1999/xhtml">Hardware</a>
</li>
<li>
<a href="http://msdn.microsoft.com/ie" id="Column1_726_15" xmlns="http://www.w3.org/1999/xhtml">Internet Explorer</a>
</li>
</ul>
</div>
</div>
</div>
</div>
<div data-fragmentname="Column2" id="Fragment_Column2" xmlns="http://www.w3.org/1999/xhtml">
<div class="ListOfLinkLists">
<div class="listItems">
<div class="linkList" xmlns="http://www.w3.org/1999/xhtml">
<div class="linkListTitle">Related developer sites</div>
<ul class="links">
<li>
<a href="http://go.microsoft.com/fwlink/p/?linkid=285622" id="Column2_726_18" xmlns="http://www.w3.org/1999/xhtml">Microsoft Connect</a>
</li>
<li>
<a href="http://go.microsoft.com/fwlink/p/?linkid=285623" id="Column2_726_19" xmlns="http://www.w3.org/1999/xhtml">.NET Framework</a>
</li>
<li>
<a href="http://go.microsoft.com/fwlink/p/?linkid=282089" id="Column2_726_20" xmlns="http://www.w3.org/1999/xhtml">Visual Studio</a>
</li>
<li>
<a href="http://go.microsoft.com/fwlink/p/?linkid=282087" id="Column2_726_22" xmlns="http://www.w3.org/1999/xhtml">Windows Server</a>
</li>
</ul>
</div>
<div class="linkList" xmlns="http://www.w3.org/1999/xhtml">
<div class="linkListTitle">Other Windows sites</div>
<ul class="links">
<li>
<a href="http://go.microsoft.com/fwlink/p/?linkid=280294" id="Column2_726_23" xmlns="http://www.w3.org/1999/xhtml">Enterprise</a>
</li>
<li>
<a href="http://go.microsoft.com/fwlink/p/?linkid=280295" id="Column2_726_24" xmlns="http://www.w3.org/1999/xhtml">Small business</a>
</li>
<li>
<a href="http://go.microsoft.com/fwlink/p/?linkid=280296" id="Column2_726_25" xmlns="http://www.w3.org/1999/xhtml">Students</a>
</li>
<li>
<a href="http://go.microsoft.com/fwlink/p/?linkid=280297" id="Column2_726_26" xmlns="http://www.w3.org/1999/xhtml">Home users</a>
</li>
</ul>
</div>
</div>
</div>
</div>
<div data-fragmentname="Column3" id="Fragment_Column3" xmlns="http://www.w3.org/1999/xhtml">
<div class="ListOfLinkLists">
<div class="listItems">
<div class="linkList" xmlns="http://www.w3.org/1999/xhtml">
<div class="linkListTitle">Downloads</div>
<ul class="links">
<li>
<a href="http://go.microsoft.com/fwlink/p/?linkid=267554" id="Column3_726_27" xmlns="http://www.w3.org/1999/xhtml">Windows 8.1</a>
</li>
<li>
<a href="http://go.microsoft.com/fwlink/p/?linkid=328183" id="Column3_726_28" xmlns="http://www.w3.org/1999/xhtml">Windows SDK</a>
</li>
<li>
<a href="http://go.microsoft.com/fwlink/p/?linkid=316619" id="Column3_726_29" xmlns="http://www.w3.org/1999/xhtml">Visual Studio Express 2013</a>
</li>
<li>
<a href="http://go.microsoft.com/fwlink/p/?linkid=285626" id="Column3_726_30" xmlns="http://www.w3.org/1999/xhtml">More downloads</a>
</li>
</ul>
</div>
<div class="linkList" xmlns="http://www.w3.org/1999/xhtml">
<div class="linkListTitle">Support</div>
<ul class="links">
<li>
<a href="http://go.microsoft.com/fwlink/p/?linkid=285632" id="Column3_726_43" xmlns="http://www.w3.org/1999/xhtml">Forums</a>
</li>
<li>
<a href="http://go.microsoft.com/fwlink/p/?linkid=285633" id="Column3_726_44" xmlns="http://www.w3.org/1999/xhtml">More support options</a>
</li>
</ul>
</div>
</div>
</div>
</div>
<div data-fragmentname="Column4" id="Fragment_Column4" xmlns="http://www.w3.org/1999/xhtml">
<div class="ListOfLinkLists">
<div class="listItems">
<div class="linkList" xmlns="http://www.w3.org/1999/xhtml">
<div class="linkListTitle">Essentials</div>
<ul class="links">
<li>
<a href="http://go.microsoft.com/fwlink/p/?linkid=285627" id="Column4_726_35" xmlns="http://www.w3.org/1999/xhtml">Windows APIs</a>
</li>
<li>
<a href="http://go.microsoft.com/fwlink/p/?linkid=285628" id="Column4_726_36" xmlns="http://www.w3.org/1999/xhtml">Samples</a>
</li>
<li>
<a href="http://go.microsoft.com/fwlink/p/?linkid=285629" id="Column4_726_37" xmlns="http://www.w3.org/1999/xhtml">Compatibility and certification</a>
</li>
<li>
<a href="http://go.microsoft.com/fwlink/p/?linkid=285630" id="Column4_726_45" xmlns="http://www.w3.org/1999/xhtml">Desktop dashboard</a>
</li>
</ul>
</div>
<div class="linkList" xmlns="http://www.w3.org/1999/xhtml">
<div class="linkListTitle">Stay connected</div>
<ul class="links">
<li>
<a href="http://go.microsoft.com/fwlink/p/?linkid=285954" id="Column4_726_41" xmlns="http://www.w3.org/1999/xhtml">Microsoft events</a>
</li>
<li>
<a href="http://go.microsoft.com/fwlink/p/?linkid=313895" id="Column4_726_39" xmlns="http://www.w3.org/1999/xhtml">Building Apps for Windows Devices</a>
</li>
</ul>
</div>
</div>
</div>
</div>
</div>
<div id="baseFooterLogos">
<span class="microsoftlogo" title="Microsoft"></span>
<a href="https://msdn.microsoft.com/en-us" class="msdnlogo" title="MSDN"></a>
</div>
<div id="baseFooter">
<div id="FooterCopyright">© 2015 Microsoft</div>
<div data-fragmentname="BaseFooter" id="Fragment_BaseFooter" xmlns="http://www.w3.org/1999/xhtml">
<div class="linkList">
<ul class="links horizontal">
<li>
<a href="http://go.microsoft.com/fwlink/?LinkId=248681" id="BaseFooter_35351_3" xmlns="http://www.w3.org/1999/xhtml">Privacy and Cookies</a>
</li>
<li>
<a href="http://go.microsoft.com/fwlink/p/?linkid=248155" id="BaseFooter_35351_1" xmlns="http://www.w3.org/1999/xhtml">Terms of Use</a>
</li>
<li>
<a href="http://go.microsoft.com/fwlink/p/?linkid=248154" id="BaseFooter_35351_2" xmlns="http://www.w3.org/1999/xhtml">Trademarks</a>
</li>
<li>
<a href="http://go.microsoft.com/fwlink/p/?LinkId=400453" id="BaseFooter_730_5" xmlns="http://www.w3.org/1999/xhtml">Site map</a>
</li>
</ul>
</div>
</div>
<div data-fragmentname="HelloText" id="Fragment_HelloText" xmlns="http://www.w3.org/1999/xhtml">Hello from Seattle.
</div>
<span id="selectLocaleFromPopUp">
<div class="locale-selector" style="position: relative;">
<a class="current-locale" href="javascript:void(0)">
<span class="text">English</span>
<span class="gear"></span>
</a>
<div class="locale-selection-panel site-flag site-flag-lang" style="top: -245px; display: none;">
<div class="content">
<table class="all-locales" cellspacing="0" autogeneratecolumns="false" allowpaging="false" allowsorting="false" style="border-collapse: collapse;">
<tbody>
<tr>
<td><a title="Deutsch" href="http://msdn.microsoft.com/?action=SelectLocale&currentLocale=en-us&newLocale=de-de&fromPage=/en-us/library/windows/desktop/ms741688(v=vs.85).aspx/" class="locale-link">Deutsch</a></td>
<td><a title="English" href="http://msdn.microsoft.com/?action=SelectLocale&currentLocale=en-us&newLocale=en-us&fromPage=/en-us/library/windows/desktop/ms741688(v=vs.85).aspx/" class="locale-link selected">English</a></td>
<td><a title="Español" href="http://msdn.microsoft.com/?action=SelectLocale&currentLocale=en-us&newLocale=es-es&fromPage=/en-us/library/windows/desktop/ms741688(v=vs.85).aspx/" class="locale-link">Español</a></td>
<td><a title="Français" href="http://msdn.microsoft.com/?action=SelectLocale&currentLocale=en-us&newLocale=fr-fr&fromPage=/en-us/library/windows/desktop/ms741688(v=vs.85).aspx/" class="locale-link">Français</a></td>
</tr><tr>
<td><a title="Italiano" href="http://msdn.microsoft.com/?action=SelectLocale&currentLocale=en-us&newLocale=it-it&fromPage=/en-us/library/windows/desktop/ms741688(v=vs.85).aspx/" class="locale-link">Italiano</a></td>
<td><a title="日本語" href="http://msdn.microsoft.com/?action=SelectLocale&currentLocale=en-us&newLocale=ja-jp&fromPage=/en-us/library/windows/desktop/ms741688(v=vs.85).aspx/" class="locale-link">日本語</a></td>
<td><a title="한국어" href="http://msdn.microsoft.com/?action=SelectLocale&currentLocale=en-us&newLocale=ko-kr&fromPage=/en-us/library/windows/desktop/ms741688(v=vs.85).aspx/" class="locale-link">한국어</a></td>
<td><a title="Português" href="http://msdn.microsoft.com/?action=SelectLocale&currentLocale=en-us&newLocale=pt-br&fromPage=/en-us/library/windows/desktop/ms741688(v=vs.85).aspx/" class="locale-link">Português</a></td>
</tr><tr class="last">
<td><a title="Pусский" href="http://msdn.microsoft.com/?action=SelectLocale&currentLocale=en-us&newLocale=ru-ru&fromPage=/en-us/library/windows/desktop/ms741688(v=vs.85).aspx/" class="locale-link">Pусский</a></td>
<td><a title="简体中文" href="http://msdn.microsoft.com/?action=SelectLocale&currentLocale=en-us&newLocale=zh-cn&fromPage=/en-us/library/windows/desktop/ms741688(v=vs.85).aspx/" class="locale-link">简体中文</a></td>
<td><a title="繁體中文" href="http://msdn.microsoft.com/?action=SelectLocale&currentLocale=en-us&newLocale=zh-tw&fromPage=/en-us/library/windows/desktop/ms741688(v=vs.85).aspx/" class="locale-link">繁體中文</a></td>
</tr>
</tbody>
</table>
<div class="arrow">
&nbsp;</div>
</div>
</div>
</div>
</span>
<link type="text/css" rel="stylesheet">
<div class="clear"></div>
</div>
</div>
</div>
<div class="footerPrintView">
<div class="footerCopyrightPrintView">© 2015 Microsoft</div>
</div>
<input id="MtpsDevice" type="hidden" value="Default">
<!--[CDATA[ Third party scripts and code linked to or referenced from this website are licensed to you by the parties that own such code, not by Microsoft. See ASP.NET Ajax CDN Terms of Use – http://www.asp.net/ajaxlibrary/CDN.ashx. ]]-->
<noscript>&lt;div&gt;&lt;img alt="DCSIMG" id="Img1" width="1" height="1" src="https://m.webtrends.com/dcsmgru7m99k7mqmgrhudo0k8_8c6m/njs.gif?dcsuri=/nojavascript&amp;amp;WT.js=No" /&gt;&lt;/div&gt;</noscript>
<noscript>
&lt;a href="http://www.omniture.com" title="Web Analytics"&gt;
&lt;img src="//msstonojsmsdn.112.2o7.net/b/ss/msstonojsmsdn/1/H.20.2--NS/0" height="1" width="1" border="0" alt="" /&gt;
&lt;/a&gt;
</noscript>
<div id="globalRequestVerification">
<input name="__RequestVerificationToken" type="hidden" value="-vKfO3afbXC9wecuOZ_ZH0lUbIW3hOrGXM8DsDrO_VJvoCHYw8MDtTjzzB9lmSMBTtKPMiX-yIy3x0LERfAweNJ5vS01">
</div>
</div>
<script type="text/javascript" class="mtps-injected">
/*<![CDATA[*/
(function(window,document){"use strict";function preload(scripts){for(var result=[],script,e,i=0;i<scripts.length;i++)script=scripts[i],script.hasOwnProperty("url")&&(e=document.createElement("script"),e.src=script.url,script.throwaway=e),result.push(script);return result}function inject(scripts,index){var script,elem;if(index>=scripts.length){delete mtps.injectScripts;return}script=scripts[index];elem=document.createElement("script");elem.className="mtps-injected";elem.async=!1;var isLoaded=!1,timeoutId=0,injectNextFnName="",injectNext=elem.onerror=function(){isLoaded||(isLoaded=!0,inject(scripts,index+1),window.clearTimeout(timeoutId),elem.onload=elem.onerror=elem.onreadystatechange=null,injectNextFnName&&delete mtps[injectNextFnName],elem.removeEventListener&&elem.removeEventListener("load",injectNext,!1))};elem.addEventListener?elem.addEventListener("load",injectNext,!1):elem.readyState==="uninitialized"?elem.onreadystatechange=function(){(this.readyState==="loaded"||this.readyState==="complete")&&injectNext()}:elem.onload=injectNext;script.hasOwnProperty("url")?(timeoutId=window.setTimeout(injectNext,12e4),elem.src=script.url):(injectNextFnName="_injectNextScript_"+index,mtps[injectNextFnName]=injectNext,timeoutId=window.setTimeout(injectNext,2e3),elem.text="try {\n"+script.txt+"\n} finally { MTPS."+injectNextFnName+" && MTPS."+injectNextFnName+"(); }");parent.appendChild(elem)}var mtps=window.MTPS||(window.MTPS={}),parent=document.getElementsByTagName("head")[0];mtps.injectScripts=function(scripts){inject(preload(scripts),0)}})(window,document);
MTPS.injectScripts([
{ txt: "/**/\r\n(window.MTPS || (window.MTPS = {})).cdnDomains || (window.MTPS.cdnDomains = { \r\n\t\"image\": \"https://i-msdn.sec.s-msft.com\", \r\n\t\"js\": \"https://i2-msdn.sec.s-msft.com\", \r\n\t\"css\": \"https://i-msdn.sec.s-msft.com\", \r\n\t\"\": \"https://\", \r\n\t\"xap\": \"https://msdn.microsoft.com\"\r\n});\r\n/**/" },
{ url: "https://ajax.aspnetcdn.com/ajax/jQuery/jquery-1.8.2.min.js" },
{ txt: "//\n var literalNormalizedUrl = \u0027/en-us/library/windows/desktop/ms741688(l=en-us,v=vs.85).aspx\u0027;\n var wt_nvr_ru = \u0027WT_NVR_RU\u0027;\n var wt_fpcdom = \u0027.microsoft.com\u0027;\n var wt_domlist = \u0027msdn.microsoft.com\u0027;\n var wt_pathlist = \u0027\u0027;\n var wt_paramlist = \u0027DCSext.mtps_devcenter\u0027;\n var wt_siteid = \u0027MSDN\u0027;\n var gDomain = \u0027m.webtrends.com\u0027;\n var gDcsId = \u0027dcsmgru7m99k7mqmgrhudo0k8_8c6m\u0027;\n var gFpc = \u0027WT_FPC\u0027;\n\n\n\n if (document.cookie.indexOf(gFpc + \"=\") == -1) {\n var wtidJs = document.createElement(\"script\");\n wtidJs.src = \"//\" + gDomain + \"/\" + gDcsId + \"/wtid.js\";\n document.getElementsByTagName(\"head\")[0].appendChild(wtidJs);\n }\n\n\n\n var detectedLocale = \u0027en-us\u0027;\n var wtsp = \u0027_msdn_\u0027;\n var gTrackEvents = \u00270\u0027;\n/**/" },
{ txt: "/**/\n var omni_guid = \"c068ae2d-a675-46b7-b3a6-29fe9df23e5e\";\n/**/" },
{ txt: "//\n\n window.appInsightsId = \u002760854590-027a-4ae4-98be-2741a40f355f\u0027;\n //" },
{ url: "https://i2-msdn.sec.s-msft.com/Combined.js?resources=0:Utilities,1:Rating,0:Topic,2:webtrendsscript,3:omni_rsid_MSDN,0:AppInsightsPerf,4:Toc,1:SearchBox;/Areas/Epx/Content/Scripts:0,/Areas/Epx/Themes/Base/Content:1,/Areas/Global/Content/Webtrends/resources:2,/Areas/Global/Content/Omniture/resources/MSDN:3,/Areas/Library/Content:4\u0026amp;hashKey=CD797F85BF9590D82AEAECC2C4A03FC8\u0026amp;v=45B20E710D8A51EDDE9D2FACD3F9FBEA" },
{ url: "https://i1.services.social.microsoft.com/search/Widgets/SearchBox.jss?boxid=HeaderSearchTextBox\u0026btnid=HeaderSearchButton\u0026brand=MSDN\u0026loc=en-us\u0026Refinement=181\u0026focusOnInit=false\u0026iroot=windows%2fdesktop\u0026emptyWatermark=true\u0026searchButtonTooltip=Search" },
{ url: "https://i2-msdn.sec.s-msft.com/Combined.js?resources=0:TocDropDown,1:NavigationResize;/Areas/Epx/Themes/Windows/Content:0,/Areas/Library/Content:1\u0026amp;hashKey=D158B2010A6B5AB806BFFA399599FB66\u0026amp;v=45B20E710D8A51EDDE9D2FACD3F9FBEA" },
{ url: "https://ajax.aspnetcdn.com/ajax/jquery.templates/beta1/jquery.tmpl.min.js" },
{ url: "https://i2-msdn.sec.s-msft.com/Combined.js?resources=0:CommunityContent,0:LibraryMemberFilter,1:Toc_Fixed,2:SelectLocaleFromPopUp,1:CodeSnippet,1:TopicNotInScope,1:CollapsibleArea,1:VersionSelector,1:SurveyBroker;/Areas/Library/Content:0,/Areas/Epx/Content/Scripts:1,/Areas/Epx/Themes/Base/Content:2\u0026amp;hashKey=7806B2478E0DC4023BB82CB6D0A73A70\u0026amp;v=45B20E710D8A51EDDE9D2FACD3F9FBEA" },
{ txt: "$(document).ready(function() {\n try {\n var token = $(\"#globalRequestVerification input[name=\u0027__RequestVerificationToken\u0027]\").clone();\n $(\"#siteFeedbackForm\").append(token);\n } catch(err) {\n \n }\n });" }
]);
/*]]>*/
</script>
<script src="./WSARecv function (Windows)_files/broker-config.js"></script></body></html>
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化