RE: Disabling algorithms

"smeag0l" <[email protected]>
Newsgroups gmane.linux.redhat.release.shrike
Message-ID <[email protected]>
Thanks brian

-----Original Message-----
From: [email protected] [mailto:[email protected]]
On Behalf Of Brian T. Brunner
Sent: Friday, September 24, 2004 9:28 AM
To: [email protected]
Subject: Re: Disabling algorithms


Nagle Algorithm disable:

setsockopt(fd,IPPROTO_TCP,TCP_NODELAY,&x,sizeof(x));

For other opt(s), 
man 7 tcp
man 7 ip
man 7 socket
man setsockopt

To make setting options fairly painless (once I figured out what they were
and what values I wanted for them)
I wrote a macro
#define MAYBEDO(a,b,c,d,e,f,g) { if ((a) == 0) {(a) |=
setsockopt(c,d,e,f,g); b++;}}
and used it thus:
	int val = 1;
	int step = 0;
	int errval = 0;
	struct linger myLinger = {1,1};
                errno=0;
	
MAYBEDO(errval,step,fd,SOL_SOCKET,SO_LINGER,&myLinger,sizeof(myLinger));
	MAYBEDO(errval,step,fd,SOL_SOCKET,SO_REUSEADDR,&val,sizeof(val));
	MAYBEDO(errval,step,fd,SOL_SOCKET,SO_KEEPALIVE,&val,sizeof(val));
	val = 4;
	MAYBEDO(errval,step,fd,SOL_TCP,TCP_KEEPINTVL,&val,sizeof(val));
	MAYBEDO(errval,step,fd,SOL_TCP,TCP_KEEPIDLE,&val,sizeof(val));
	MAYBEDO(errval,step,fd,SOL_TCP,TCP_KEEPCNT,&val,sizeof(val));
	MAYBEDO(errval,step,fd,IPPROTO_TCP, TCP_NODELAY,&val,sizeof(val));

Then I check errval, step, and errno.

Brian Brunner
[email protected]
(610)796-5838

>>> [email protected] 09/23/04 10:18PM >>>
Hello, does anyone know how to disable the "Nagle Algorithm "     and the
"Delayed Acknowledgement algorithm"   in RedHat 9?

Thanks
Ryan


-- 
Shrike-list mailing list
[email protected] 
https://www.redhat.com/mailman/listinfo/shrike-list

*******************************************************************
This email and any files transmitted with it are confidential and
intended solely for the use of the individual or entity to whom they
are addressed. If you have received this email in error please notify
the system manager.

This footnote also confirms that this email message has been swept
for the presence of computer viruses.

www.hubbell.com - Hubbell Incorporated


-- 
Shrike-list mailing list
[email protected]
https://www.redhat.com/mailman/listinfo/shrike-list


-- 
Shrike-list mailing list
[email protected]
https://www.redhat.com/mailman/listinfo/shrike-list
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.