in reply to Forking problems
I suspect your biggest problem is that your child processes don't exit explicitly, they just continue. Throw an exit after the close.
If that doesn't work, you ought to post the exact output you receive.
While you're cleaning things up, you might notice that nothing will really happen unless $class is 2. You probably want to call checkhost() in the other branches.
|
|---|