LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 04-16-2010, 06:06 AM   #1
tclwp
Member
 
Registered: Jan 2005
Posts: 37

Rep: Reputation: 15
setsockopt(fd, SOL_SOCKET, SO_SNDBUF.....) still takes no effect after connect() ?


Hi,guys
Now I learned that on Solaris, we can set TCP_NODELAY,SO_RCVBUF, SO_SNDBUF by setsockopt() any time before or after calling connect() or listen() , if the buffer size we need is greater than default(or last) size,the setsockopt() will take affect .
But on LINUX, man 7 tcp tell us: On individual connections, the socket buffer size must be set prior to the listen(2) or connect(2) calls in order to have it take effect.
Does current newly LINUX kernel keeps this limitation as the manual said ?
 
Old 04-17-2010, 03:32 AM   #2
tclwp
Member
 
Registered: Jan 2005
Posts: 37

Original Poster
Rep: Reputation: 15
I have read some linux kernel source (net/ipv4/tcp_input.c) ,and determine that :
tcp_init_buffer_space()->tcp_fixup_sndbuf()

so , on newly linux kernel, you can call setsockopt(fd, SOL_SOCKET, SO_SNDBUF...) after the socket changed to ESTABLISHED state, and
sk->sk_sndbuf is modified by setsockopt() indeed, but tcp_fixup_sndbuf() was not called, so here setsockopt(fd, SOL_SOCKET, SO_SNDBUF...) takes no effect
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
It takes around 4/5 minutes to connect to RHEL5 server Avadhut Linux - Newbie 3 05-29-2009 10:04 PM
Networkmanager 0.6.4 takes long time to connect TedyBear Linux - Wireless Networking 6 09-17-2007 02:44 AM
what takes longer? system() or connect() (C/C++) Thinking Programming 6 03-03-2006 09:54 PM
Postfix: "smtpd_client_restrictions" takes no effect? Chowroc Linux - Networking 5 11-01-2005 09:42 AM
Takes ages to connect to smtp Swakoo Linux - General 3 08-23-2005 03:32 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 01:26 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration