?
Solved

Linux socket programming listen() problem

Posted on 2004-09-30
2
Medium Priority
?
723 Views
Last Modified: 2010-08-05
I have an smtp server program which accepts connections and forks child processes to handle the packet exchange. After the fork, the parent closes the child's socket and the child closes the original listen socket. When the parent shuts down, as long as any children are left I am not able to restart the program. It is unable to bind to the port. netstat does not show any process in LISTEN mode on that port, just the child process with is connection to the remote client.

Is there any way to free up the port for listening without shutting down the child processes?
0
Comment
Question by:billzxy
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 4

Accepted Solution

by:
alikoank earned 2000 total points
ID: 12200584
call setsockopt with option  SO_REUSEADDR
0
 
LVL 1

Author Comment

by:billzxy
ID: 12201195
Great, that took care of it
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The purpose of this article is to fix the unknown display problem in Linux Mint operating system. After installing the OS if you see Display monitor is not recognized then we can install "MESA" utilities to fix this problem or we can install additio…
The purpose of this article is to demonstrate how we can upgrade Python from version 2.7.6 to Python 2.7.10 on the Linux Mint operating system. I am using an Oracle Virtual Box where I have installed Linux Mint operating system version 17.2. Once yo…
This is my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…
Suggested Courses
Course of the Month14 days, 3 hours left to enroll

800 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question