Project Home
Project Home
Wiki
Wiki
Discussion Forums
Discussions
Project Information
Project Info
BroadcastCommunity.qnx.com will be offline from May 31 6:00pm until June 2 12:00AM for upcoming system upgrades. For more information please go to https://community.qnx.com/sf/discussion/do/listPosts/projects.bazaar/discussion.bazaar.topc28418
Forum Topic - Integrating a service with inetd: Page 1 of 7 (7 Items)
   
Integrating a service with inetd  
We have several services (both TCP and UDP-based) that we would like to integrate with inetd so as to reduce the system 
load.  We have a TCP service that we would like to tightly control the number of incoming connection requests as well as
 the number of established connections, so it would seem like having the service be a "wait" service, where our app 
performs an accept() on the socket that inetd was listening on and then continue to listen()/accept() until the maximum 
number of connections are handled, and when the servers goes idle for a period of time, exiting to let inetd resume 
listening.  So far, so good.  However, the help pages for inetd.conf has the following statements:

"Stream servers are usually marked as nowait, but if a single server process is to handle multiple connections it may be
 marked as wait. The master socket is passed as fd 0 to the server, which then needs to accept the incoming connection. 
The server should eventually time out and exit when no more connections are active. The inetd daemon will continue to 
listen on the master socket for connections, so the server should not close it when it exits. The identd server is 
usually the only stream server marked as wait."

I don't know what "so the server should not close it (the master socket) when it exits" means.  All file descriptors of 
a process are closed when a process exits.

Any help understanding what's meant by this?

Thanks,

Gordon Molek
Zebra Technologies Corp.