Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Re: child and parent process communication

by zentara (Archbishop)
on Sep 03, 2008 at 13:48 UTC ( [id://708756]=note: print w/replies, xml ) Need Help??


in reply to child and parent process communication

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
  • Comment on Re: child and parent process communication

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://708756]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others sharing their wisdom with the Monastery: (6)
As of 2024-04-23 19:19 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found