The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > High Level Programming
Google UNIX.COM


High Level Programming Post questions about C, C++, Java, SQL, and other programming languages here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
problem with socket reading swap007 UNIX for Advanced & Expert Users 2 05-20-2008 10:08 PM
Cloning a socket connection, using other port numbers jonas.gabriel High Level Programming 4 12-10-2007 12:10 PM
Socket programming:One server two port abc.working UNIX for Dummies Questions & Answers 1 10-17-2007 09:32 AM
Socket Problem Agent007 High Level Programming 3 04-03-2004 05:15 PM
socket on serial port kintoo High Level Programming 2 07-31-2001 12:44 AM

Reply
 
Submit Tools LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 11-28-2003
Registered User
 

Join Date: Oct 2003
Posts: 4
Stumble this Post!
[Problem]Reuse port in BSD socket

I write a chat server using BSD socket, which is listen to
an specific port, say 1212. After the chat server is shutdown,
I want to execute the program again. But kernel will say that
the port 1212 is now unavailable. I have to wait for a while to
reuse the port 1212.

I am sure there's no other user using the same port on the
workstation.

Please tell me how to reuse the port.

thanks for help.
Reply With Quote
Forum Sponsor
  #2 (permalink)  
Old 11-28-2003
Perderabo's Avatar
Unix Daemon
 

Join Date: Aug 2001
Location: Washington DC Area
Posts: 8,449
Stumble this Post!
Use setsockopt() to turn on SO_REUSEADDR.
Reply With Quote
Google The UNIX and Linux Forums
Reply

Thread Tools
Display Modes




All times are GMT -7. The time now is 01:56 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008 The CEP Blog All Rights Reserved -Ad Management by RedTyger Visit The Global Fact Book

Content Relevant URLs by vBSEO 3.2.0