Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Linux socket programming listen() problem

Posted on 2004-09-30
2
Medium Priority
?
725 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

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Have you ever been frustrated by having to click seven times in order to retrieve a small bit of information from the web, always the same seven clicks, scrolling down and down until you reach your target? When you know the benefits of the command l…
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…
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…
In response to a need for security and privacy, and to continue fostering an environment members can turn to for support, solutions, and education, Experts Exchange has created anonymous question capabilities. This new feature is available to our Pr…
Suggested Courses

636 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