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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T15:18:08+00:00 2026-06-07T15:18:08+00:00

I have a non-blocking winsock socket that is recv ‘ing data in a loop.

  • 0

I have a non-blocking winsock socket that is recv‘ing data in a loop.

I noticed that when connecting with, say, putty and a raw socket, sending messages works just fine. However, when interfacing with this particular client, the packets seem to not be triggering a successful, non-MSG_PEEK call to recv. I recall having a similar issue a few years back and it ended up having to end the packets in \r or something coming from the client, which isn’t possible in this case since I cannot modify the client.

Wireshark shows the packets coming through just fine; my server program, however, isn’t working quite right.

How would I fix this?

EDIT: Turning the buffer size down to, say, 8 resulted in a few successful calls to recv without MSG_PEEK.

Recv call:

iLen = recv(group->clpClients[cell]->_sock, // I normally call without MSG_PEEK
        group->clpClients[cell]->_cBuff, CAPS_CLIENT_BUFFER_SIZE, MSG_PEEK);
if(iLen != SOCKET_ERROR)
{
    ...

Socket is AF_INET, SOCK_STREAM and IPPROTO_TCP.

  • 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-07T15:18:10+00:00Added an answer on June 7, 2026 at 3:18 pm

    Use setsockopt to set TCP_NODELAY to TRUE.

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

Sidebar

Related Questions

say i have the 3 non blocking sends like this MPI_Isend (); MPI_Isend ();
I have a non-blocking function (it returns immediately) that creates a new thread to
I have non blocking UDP socket in perl created this way my $my_sock =
I'm writing a program using Java non-blocking socket and TCP. I understand that TCP
Is it possible to implement a non-blocking client socket? I have tried using sockfd
I have written a server that performs non-blocking IO using the Java NIO API.
According to MSDN you have to create a non-blocking socket like this: unsigned nonblocking
I have a unit test that checks behavior on blocking and non-blocking sockets -
I have a single-threaded non-blocking socket IO server written in Java using nio. When
I have the following workflow that needs to happen in a non-blocking parallel processing

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.