Re: [LIP] How does the forked child process handles the network connection

"Arun Sharma" <[email protected]>
Newsgroups gmane.user-groups.linux.india.programmers
Message-ID <[email protected]>
> Hello All,
>
> I have a question regarding end-end communication with tcp ports.
>
> Most of the services like http listens on privileged port (80). To handle
> multiple connections, the privileged process providing the service usually
> forks a (less privileged) child which in turn handles the connection.
>
> But the child still uses the same privileged port for the end-end
> connection. How does this works. Or the child uses a different port.
>

You need the privileges when you bind() to the privileged port. The child
doesn't need the previleges to accept() from the port. It has already
inherited a socket bound to the privileged port.

 -Arun



-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.