The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

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-21-2008 02:08 AM
Cloning a socket connection, using other port numbers jonas.gabriel High Level Programming 4 12-10-2007 04:10 PM
Socket programming:One server two port abc.working UNIX for Dummies Questions & Answers 1 10-17-2007 01:32 PM
Socket Problem Agent007 High Level Programming 3 04-03-2004 09:15 PM
socket on serial port kintoo High Level Programming 2 07-31-2001 04:44 AM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 11-28-2003
Namely Namely is offline
Registered User
  
 

Join Date: Oct 2003
Posts: 4
[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.
  #2 (permalink)  
Old 11-28-2003
Perderabo's Avatar
Perderabo Perderabo is offline Forum Staff  
Unix Daemon
  
 

Join Date: Aug 2001
Location: Ashburn, Virginia
Posts: 9,123
Use setsockopt() to turn on SO_REUSEADDR.
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 09:06 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0