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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T20:12:48+00:00 2026-06-15T20:12:48+00:00

I am making one non-blocking send call on one socket and next a blocking

  • 0

I am making one non-blocking send call on one socket and next a blocking receive on another socket. After that I want to check if the non-blocking send succeeded or failed. How can this be done?

    while (i)
    {
      retval = send (out_sd, s_message, strlen (s_message), MSG_DONTWAIT);
      retval = recv (client_sd, r_message, MSG_LEN, 0);
      r_message[retval] = '\0';
      /* Here I want to wait for the non-blocking send to complete */
      strcpy (s_message, r_message);
      strcpy (r_message, "");
      i--;
    }
  • 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-15T20:12:49+00:00Added an answer on June 15, 2026 at 8:12 pm

    You are somehow mixing synchronous and asynchronous IO, which is normally a bit confusing, but I don’t see any practical problem in here.

    To avoid hard polling (which is keeping looking if your operation has finished in a loop) you should use a select() to wait for your channel/socket to become available for more write operations. This would tell you that the previous one was finished (or that it was fully taken in charge by your OS, which is the same).

    The select() function is the base for asynchronous IO in C, you should read about it in here, and this is an example I think might be useful to you.

    Pay attention though that select() supports read, write and exception events, the example shows a read select, you want to do a write select.

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

Sidebar

Related Questions

I was making one table that have two foreign key to another tables. But
I ran into the situation where my class is making one asynchronous web call
I'm using Zend XML-RPC Client library to send XML requests to another non-PHP XML
I have several columns and making pivot. I want to have multiple non-pivot columns
This one should be pretty simple. I am making a non-MVC ASP.NET 2.0 site.
I'm making a dll that has to respond to an application's requests. One of
I am making one application where i am reading mails from Lotus Notes. I
I am making one security related application in android so i am looking for
I'm making one part in my app where if you push the button then
I'm looking for the fastest way of: merging (it means making one image from

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.