473,473 Members | 2,029 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Can't set TCP_MAXSEG's value

Hi all,
I am using Redhat9, and trying to change a tcp socket's maxseg.

Here is part of my code:

if((sockfd = socket(AF_INET, SOCK_STREAM, 0)) == -1){
perror(NULL);
exit(-1);
}

int oldmaxseg = 0;
int size = sizeof(oldmaxseg);
if(getsockopt(sockfd, SOL_TCP, TCP_MAXSEG, &oldmaxseg,
&size) == -1){
perror(NULL);
exit(-1);
}
printf("oldmaxseg:%d size:%d\n", oldmaxseg, size);

int maxseg = 534;
if(setsockopt(sockfd, SOL_TCP, TCP_MAXSEG, &maxseg,
sizeof(maxseg)) == -1){
perror(NULL);
exit(-1);
}

if(getsockopt(sockfd, SOL_TCP, TCP_MAXSEG, &oldmaxseg,
&size) == -1){
perror(NULL);
exit(-1);
}
printf("oldmaxseg:%d size:%d\n", oldmaxseg, size);

and the code prints:
oldmaxseg:536 size:4
oldmaxseg:536 size:4

It's still 536, not 534.
It seems you can't change the maxseg in some platform.
Is it true on linux? If not, how can I change the value?

Thanks
Shin

Jul 22 '05 #1
1 3443
On 25 Jun 2004 16:31:23 GMT, Shin <ge*******@yahoo.com> wrote in
comp.lang.c++:
Hi all,
I am using Redhat9, and trying to change a tcp socket's maxseg.


[snip]

Ask this in a Linux group like news:comp.os.linux.development.apps.
It is not a C++ language question because the standard language has no
support for sockets or any type of networking.

--
Jack Klein
Home: http://JK-Technology.Com
FAQs for
comp.lang.c http://www.eskimo.com/~scs/C-faq/top.html
comp.lang.c++ http://www.parashift.com/c++-faq-lite/
alt.comp.lang.learn.c-c++
http://www.contrib.andrew.cmu.edu/~a...FAQ-acllc.html
Jul 22 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: techy techno | last post by:
Hii Just wanted to know how can I decorate my texboxes and Listmenu which is called from a JS file using the following code below: document.write("<SELECT NAME='cur2' ONCHANGE='cconv1();'>");...
16
by: cwizard | last post by:
I'm calling on a function from within this form, and there are values set but every time it gets called I get slammed with a run time error... document.frmKitAmount.txtTotalKitValue is null or not...
7
by: Fendi Baba | last post by:
The function is called from opencalendar(targetfield). Thanks for any hints on what could be the problem. .............................................................. var...
4
by: Yuk Cheng | last post by:
<<<start index.htm>>> <html> <head> <script> function perform(action){ } </script> </head>
6
by: marcelf3 | last post by:
Hello.. This page opens a window with some information, but everytime the user changes a field in the parent window, the child window needs to be closed. These 2 functions were supposed to do the...
7
by: x muzuo | last post by:
Hi guys, I have got a prob of javascript form validation which just doesnt work with my ASP code. Can any one help me out please. Here is the code: {////<<head> <title>IIBO Submit Page</title>...
5
by: Novice Computer User | last post by:
Hi. Can somebody PLEASE help. Here is a .php script. Right now, the minimum amount of time (i.e. duration) allowed is 1 month. However, I want to be able to reduce the minimum amount of time to...
0
by: Frank | last post by:
Any suggestions on how I should handle this? I was asked to convert a small web application that was written in classic ASP into ASP.NET. The original site uses some VBScript to interface with...
73
by: Claudio Grondi | last post by:
In the process of learning about some deeper details of Python I am curious if it is possible to write a 'prefix' code assigning to a and b something special, so, that Python gets trapped in an...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
1
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.