Pathologically Eclectic Rubbish Lister | |
PerlMonks |
Re: TCP Server using fork to accept multiple requestsby Anonymous Monk |
on Aug 17, 2022 at 09:14 UTC ( [id://11146187]=note: print w/replies, xml ) | Need Help?? |
In your example, the child process keeps executing the code outside the if branch. Eventually, all your child processes spawned after a successful accept() end up waiting in another accept() call for more clients and creating more children as they connect. You should probably put an exit() at the end of the if ($pid == 0) branch.
In Section
Seekers of Perl Wisdom
|
|