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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T03:52:49+00:00 2026-06-13T03:52:49+00:00

invoking this code on both Linux (Ubuntu 12.04) and Windows 7 you get very

  • 0

invoking this code on both Linux (Ubuntu 12.04) and Windows 7 you get very different results:

DatagramSocket socket = new DatagramSocket(4445);
socket.setReceiveBufferSize(Integer.MAX_VALUE);
System.out.println("SO_RX_BUFFER SET TO:"+socket.getReceiveBufferSize());

Linux you get:
SO_RX_BUFFER SET TO:131071

and on Windows you get:
SO_RX_BUFFER SET TO:2147483647

Why the drastic different between operating systems? Why such a small value for linux? Is there anyway to get the linux buffer size up?

  • 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-13T03:52:50+00:00Added an answer on June 13, 2026 at 3:52 am

    What is going on here is that the host operating systems are behaving differently.

    • In the Linux case, the OS is placing an upper limit on what you can ask for from an application. To address this, you would need to change the OS configuration settings. That will require “root” privilege and should not be done by an application.

      This page has some basic information on Linux network tuning.

    • In the Windows case, the OS either doesn’t place a limit or (more likely) it silently overrides the user requested buffer size if it is larger than an OS imposed limit.


    Having said this, you need think about what you are doing here. Buffered network packets (RX and TX) most likely have to be held in physical memory. When you increase the limits, you are forcing the OS to reserve more RAM pages for itself, reducing the memory available for normal applications.

    The second issue is that increasing the amount of network buffering can be harmful if the basic problem is that your application has difficulty keeping up. In the worst case, your application will be continually processing old packets, with new packets being discarded. In short, the extra buffering makes the latency worse without (necessarily) eliminating data loss.

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

Sidebar

Related Questions

When invoking a query on the data service I get this error message inside
Weird one this, Both my Java and C code seem to be working fine.
According to this answer: Invoking JavaScript code in an iframe from the parent page
Am using Mediainfo library in my C# project,before start invoking this dll,i just ran
I know this represents the object invoking the method and static methods are not
This is how I am invoking the click : $(#myDivId).click(function(e) { callAjax(); window.location =
Is this valid C++ (e.g. not invoking UB) and does it achieve what I
A few days ago I asked this question about jquery ajax function invoking action
Is it possible to access the errno variable in C# when P/Invoking? This is
(See this question in ServerFault ) I have a Java client that uses Socket

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.