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

  • Home
  • SEARCH
  • 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 3440272
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T08:24:45+00:00 2026-05-18T08:24:45+00:00

From the recv(2) man page: MSG_WAITALL This flag requests that the operation block until

  • 0

From the recv(2) man page:

MSG_WAITALL

This flag requests that the operation block until the full request is satisfied. However, the call may still return less data than requested if a signal is caught, an error or disconnect occurs, or the next data to be received is of a different type than that returned.

It doesn’t look like there’s an equivalent flag for send(2), which strikes me as strange. Maybe send()s are guaranteed to always accept the whole buffer, but I don’t see that written anywhere (and anyway, that seems unlikely to me).

Is there a way to tell send() to wait until it’s sent the whole buffer before returning, equivalently to recv()‘s MSG_WAITALL?

Edit: I understand that send() just copies data into a buffer in the operating system and that I can’t force send() to put data onto the wire. My question is: Can I force send() to block until all the data I gave it has been copied into the OS’s buffer?

  • 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-18T08:24:46+00:00Added an answer on May 18, 2026 at 8:24 am

    You can’t. send just offloads the buffer to the kernel, then returns.

    To quote from the Unix standard:

    The send() function shall initiate transmission of a message from the specified socket to its peer (…)
    Successful completion of a call to send() does not guarantee delivery of the message.

    Note the word “initiate”. It doesn’t actually send anything, rather tells the OS to send the message when it’s ready for it (when its buffers are full or after some time has passed).

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

Sidebar

Related Questions

I have a C program that do recv/send operations from/to socket using a for(;;)
I'm using the code from MSDN's recv() page , but I changed the data
This looks like a duplicate of How do I abort a socket.recv() from another
From test, I concluded that in following three cases the socket.recv(recv_size) will return. After
I need to recv() data from a socket and store it into a buffer,
when I use recv from windows sockets does using recv can lead to denial
I'm using select() to recv() messages from server, using TCP/IP. When I send() messages
My C program has read (using read(2) or recv(2) ) a few bytes from
I'm serving requests from several XMLRPC clients over WAN. The thing works great for,
What is the best way(s) to keep the User from getting confused by this

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.