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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T04:36:15+00:00 2026-05-31T04:36:15+00:00

i created 2 programs, one to send and the other to recv the data.

  • 0

i created 2 programs, one to send and the other to recv the data.
So,

The portion to recv data is:

while ((recvMsgSize = sock->recv(echoBuffer, RCVBUFSIZE))>0) {
   write(fileno(stdout), echoBuffer, recvMsgSize);
}

If i use it to recv a large file data, it works well, with small amount of data it dont work.
I know the problem is with the recv portion because if i use netcat to recv data it works well, it recv the entire data.
Is there any other way to receive the data?

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-31T04:36:17+00:00Added an answer on May 31, 2026 at 4:36 am

    I would guess your socket is blocking and recv is waiting for RCVBUFSIZE bytes to be sent. You should send the size of the file that is going to be sent first and then count how much data you’ve received and only request the remaining portion when what you’re missing is less than RCVBUFSIZE bytes.

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

Sidebar

Related Questions

I write programs used internally by our company. I've created several support DLLs that
I use the Message Queue to send messages from one application to the other
I have created two JSP programs as follows. First One: Addmulti.jsp <html> <head><title>Upload Excel
I created one GWT webapplication project.Inthat i want to create servlet program,but in that
I want to create a button in one of my programs. When they click
Many programs have created a huge amount of swap files. They annoy me, because
I have an application consisting of two windows, one communicates to the other and
I've created a very simple PHP system to send emails to a mailinglist using
I'm trying to make a modem call in one end, and in the other
I am having trouble writing data to an excel sheet. My other part of

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.