Solved

Linux socket programming listen() problem

Posted on 2004-09-30
2
714 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
2 Comments
 
LVL 4

Accepted Solution

by:
alikoank earned 500 total points
Comment Utility
call setsockopt with option  SO_REUSEADDR
0
 
LVL 1

Author Comment

by:billzxy
Comment Utility
Great, that took care of it
0

Featured Post

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
File system unmounted 3 153
OS & DB Recommendation 4 45
specifying dependencies for an rpm 2 42
Linux "time" command output redirection 16 70
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…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

728 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

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now