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 8080637
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T16:28:47+00:00 2026-06-05T16:28:47+00:00

I’ve been wondering when the call back that’s provided with a BeginRecieve call is

  • 0

I’ve been wondering when the call back that’s provided with a BeginRecieve call is triggered.

  • Is it when it received as much data as the buffer can hold?
    And if so – what if the data is smaller than the buffer)
  • Is it when it received one TCP/IP packet?
  • Is it something else?

I found a similair question which I will repeat as I can’t put it much clearer:

Now all documentation says that the callback, as specified in
BeginReceive, is called as soon as ‘the data is received’. But this is
rather vague: when exactly is that moment if you don’t know how
exactly that other process is providing data?

One criterium is that BeginReceive() is considered completed (and thus
the callbask is called) when the buffer in the state object is filled
upto the specified buffersize. But what if the ‘delivering’ process is
feeding data in unknown quantities and in an irregular pattern? For
instance, if it first delivers 100 bytes consecutively, and then there
is a time interval of 1 millisecond and another 200 bytes follow: does
BeginReceive complete with 100 bytes of incoming data? Or 300?

http://www.pcreview.co.uk/forums/exactly-beginreceive-socket-considered-completed-t2899270.html

  • 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-06-05T16:28:48+00:00Added an answer on June 5, 2026 at 4:28 pm

    My experience is that it is called for any data being available without delay. This means that reads can be rather small, like 1400 bytes or so because that is on the order of the MTU size.

    Reads can be multiples of that because if packets arrive out of order all of them are made visible to application the moment the logically first one arrives. You get to read from all contiguous queued packets at once in this case.

    I guess your read size will increase on extremely fast connections because your application might fail to dequeue bytes as fast as the network delivers individual packets.

    Sidenote: The BeginReceive-callback is called at exactly the same moment Receive would have returned. You don’t get to reduce latency that way. (Latency will actually increase by a tiny amount because async operations can have higher overhead than blocking ones).

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

Sidebar

Related Questions

I have a jquery bug and I've been looking for hours now, I can't
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I've got a string that has curly quotes in it. I'd like to replace
I am doing a simple coin flipping experiment for class that involves flipping a
I have a French site that I want to parse, but am running into
I'm using v2.0 of ClassTextile.php, with the following call: $testimonial_text = $textile->TextileRestricted($_POST['testimonial']); ... and
Does anyone know how can I replace this 2 symbol below from the string

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.