Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3965304
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T03:26:42+00:00 2026-05-20T03:26:42+00:00

I have a few questions regarding WSARecv Question 1: How do I excactly determine

  • 0

I have a few questions regarding WSARecv

Question 1:
How do I excactly determine what size we must assign to the WSABUF.len?

Question 2:
Does WSARecv read data with length 0?

eg.
WSABUF.len = 0

I want to use that to use that to determine whether all packets are sent.

Question 3:
If I understand this correctly the lpNumberOfBytesRecvd holds the number of bytes actually read and not WSABUF.len, correct?

Thanks.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-20T03:26:43+00:00Added an answer on May 20, 2026 at 3:26 am

    1) WSABUF.len is the length of the buffer that you have supplied. It’s the maximum amount that can be read in this call. You know this size as it’s the size of the memory that you allocated for the buffer that WSABUF.buf points to.

    2) In certain high performance situations with many thousands of concurrent connections, when using asynchronous I/O you can set the WSABUF.len value to 0 to prevent the read from doing anything except completing to tell you that data is available. This is a performance tweak that is rarely needed and is often referred to as a ‘zero byte read’. The reason it’s useful is that it means that the I/O system doesn’t need to lock the read buffer in memory (there is no read buffer) and so this reduces the number of I/O pages locked. There’s a fixed limit on the number of I/O pages that can be locked and so this can be useful when you have many thousands of connections but they don’t send data very often. You post a zero byte read on all the connections and then post a real read when the zero byte read completes and you know that you have data available.

    3) Yes. The number of bytes actually read is returned separately via lpNumberOfBytesRecvd.

    You should probably think about message framing (which I talk about here and here as this will help you know how much data you’re expecting to read from a connection at a given time.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a few questions regarding JavaScript obfuscation on client side. First question :
i have a few questions regarding libevent2 and its multithread support. Does libevent support
I have a few questions regarding Subsonic 3: Does anyone use it in their
I am a newbie user of Frama-C and have a few questions regarding assertions
I'm very new to TDD world. I have a few questions regarding TDD. Do
I have a few basic questions regarding the syntax and usage of properties in
I have question regarding disabling browser caching. I have already found few solutions, and
I have a few questions about data synchronization. The architecture does not seem to
I have a few questions regarding differentiation between const and non-const versions of methods
I am a beginner to networking and I have a few questions regarding networking.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.