To establish a server under the inetd server, you can use
COMSTACK cs_createbysocket(int socket, CS_TYPE type, int blocking, int protocol); |
int cs_bind(COMSTACK handle, void *address, int mode) |
int cs_listen(COMSTACK handle, char *addr, int *addrlen); |
COMSTACK cs_accept(COMSTACK handle); |
char *cs_addrstr(COMSTACK); |
on an established connection to retrieve the host-name of the remote host.