For Programmers: Free Programming Magazines  


Home > Archive > Unix Programming > February 2007 > Re: how to set the socket parameters when the socket is created so









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Re: how to set the socket parameters when the socket is created so
Ian Collins

2007-02-28, 4:07 am

sunny wrote:
> Hai,
>
> how to set the socket parameters when the socket is created so that
> its file descriptor is not inherited by forked processes. I am facing
> a problem while creating a socket and then its descripotrs are
> inherited by the forked process when i restart my parent process it is
> shutting down because the port on which the socket is created is used
> by the previous child process.
>

Google for FD_CLOEXEC

--
Ian Collins.
Ian Collins

2007-02-28, 4:07 am

Barry Margolin wrote:
> In article <54kfrfF218mukU6@mid.individual.net>,
> Ian Collins <ian-news@hotmail.com> wrote:
>
> That closes sockets only if the forked process calls exec().
>

I know, but it's a good place to start looking!

--
Ian Collins.
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com