creating a server programm via inetd

I've written a simple C server with the following functions
to create a socket and listen to a port:
socket -> bind -> accept -> recv

When I start the programm from a shell everything is working.
If I try to enter the port and the service call in the
/etc/services and /etc/inetd.conf the bind call returns
that the port is occupied. (I think i is the inetd)
What network functions do I need to make the inetd start my server ???

Thanks
dibmzAsked:
Who is Participating?
 
mlevConnect With a Mentor Commented:
inetd does socket(), bind() and accept() (if applicable) for you.
When your server is started, the socket is on its file descriptor 0, and you can recv() right away.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.