LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Other *NIX Forums > Solaris / OpenSolaris
User Name
Password
Solaris / OpenSolaris This forum is for the discussion of Solaris, OpenSolaris, OpenIndiana, and illumos.
General Sun, SunOS and Sparc related questions also go here. Any Solaris fork or distribution is welcome.

Notices


Reply
  Search this Thread
Old 12-14-2005, 12:32 AM   #1
blackhole123
LQ Newbie
 
Registered: Nov 2005
Posts: 8

Rep: Reputation: 0
Bind : address already in use on solaris


Hello,
I have a SunOS5.9 mac. I have a server process which binds to a specfic port 3000 and to localhost.

The sequence of server execution is like this,
Server starts
socket opened, bind to port 3000
connect
.....
.....

.....
close() the socket

sleep(30);

restart server
during this process the bind fails.

I have verified that the server closes the socket completely(return value of close is 0).

Is this hapening because of the kernel has not completely given up the previous socket resources.

Does changing the tcp_time_wait_interval to 29s will it help...
how to clear the socket resources after the user has closed it.
 
Old 12-14-2005, 05:26 AM   #2
jlliagre
Moderator
 
Registered: Feb 2004
Location: Outside Paris
Distribution: Solaris 11.4, Oracle Linux, Mint, Debian/WSL
Posts: 9,789

Rep: Reputation: 492Reputation: 492Reputation: 492Reputation: 492Reputation: 492
Quote:
I have a SunOS5.9 mac
Really ? Porting Solaris to PPC is still a project ...
Quote:
Is this hapening because of the kernel has not completely given up the previous socket resources.
No, the resources are cleared. This delay is the expected behaviour: a port can't be reused during a defined period, TCP standard mandates 240 seconds if I recall properly.
Quote:
Does changing the tcp_time_wait_interval to 29s will it help...
It should, but you can simply workaround that by using setsockopt() with the option SO_REUSEADDR.
 
Old 12-14-2005, 05:38 AM   #3
blackhole123
LQ Newbie
 
Registered: Nov 2005
Posts: 8

Original Poster
Rep: Reputation: 0
Thanks for the reply.
it really solved the problem.
 
  


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
(98)Address already in use: make_sock: could not bind to address 0.0.0.0:443 bruvajon Linux - Software 34 11-30-2011 03:08 PM
how can i remove an address bind sibu_rajappan Linux - Networking 0 12-24-2004 01:50 AM
bind : Address already in use sheni Linux - Networking 1 11-11-2004 12:41 PM
sun-dr/tcp: bind: Address already in use choonseng Solaris / OpenSolaris 2 10-18-2004 02:48 AM
cannot bind to socket: address already in use exfacior Linux - Wireless Networking 0 09-27-2004 12:34 PM

LinuxQuestions.org > Forums > Other *NIX Forums > Solaris / OpenSolaris

All times are GMT -5. The time now is 08:28 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