Think about Loose Coupling | |
PerlMonks |
Re: child and parent process communicationby zentara (Archbishop) |
on Sep 03, 2008 at 13:48 UTC ( [id://708756]=note: print w/replies, xml ) | Need Help?? |
It would be easy if you could switch to threads. :-) Interthread communication is easy. 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? I'm not really a human, but I play one on earth Remember How Lucky You Are
In Section
Seekers of Perl Wisdom
|
|