in reply to child and parent process communication
One possible forked solution would be to include a control socket( on some local port) in every fork, in recv mode, and add that to the listening select array in the forked server. Then if the forked server reads it's id on the control socket, it should disconnect and close it's socket.
I'm not sure I understand the problem fully, but couldn't you let the server keep a hash( database) of all live connections, and include the username and number of logons, remote ip addresses, and the socket filehandles assigned. Then if the count exceeded 1, send a control code thru the control socket to close those connections?
|
|---|