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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T16:11:33+00:00 2026-05-25T16:11:33+00:00

I was reading this thread and noticed in the solution that if you send

  • 0

I was reading this thread and noticed in the solution that if you send the length of the data separate from the actual data Nagle’s algorithm may come in to play and desync the data sent.

I was wondering about this because a lot of code samples I see the client sends the length of the data first and then the data itself as to separate calls. Was this problem not affecting them somehow?

Should I concatenate the length of the data and the data itself in to a single byte array and send that in one go? If so, is there a better way to concatenate the two byte arrays without manually copying all the data from both (loops) in to the new one? Seems pretty inefficient for something that would have to occur so often (every time the user or server sends data between each other).

  • 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-25T16:11:34+00:00Added an answer on May 25, 2026 at 4:11 pm

    If you’ve created a Socket with the NoDelay option set, then you won’t be affected by the Nagle algorithm; data passed to Send will be immediately sent.

    Given this, it would be more efficient to pass a single byte array in a single Send call, rather than separate calls; each call to Send will have the overhead of a packet header.

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

Sidebar

Related Questions

I was just reading this thread and it occurred to me that there is
After reading many of the replies to this thread , I see that many
I was reading this thread/post: https://stackoverflow.com/questions/262298/windows-c-ui-technology and am also wondering about a non .NET
I was reading through this thread: Hidden Features of JavaScript? and found this post:
I noticed while reading through my code that I have a static member function
After reading this thread: NSUserDefaults not present on first run on simulator I know
I was reading this Sun's tutorial on Thread . I found a block of
I was reading this: http://en.wikipedia.org/wiki/Thread_safety Is the following function thread-safe? void foo(int y){ int
I was reading this informative page on Green Thread (Wikipedia) and I wonder: what
I was recently reading this thread , on some of the worst PHP practices.

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.