Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

Re: TCP Server using fork to accept multiple requests

by Anonymous Monk
on Aug 17, 2022 at 09:14 UTC ( [id://11146187]=note: print w/replies, xml ) Need Help??


in reply to TCP Server using fork to accept multiple requests

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.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others rifling through the Monastery: (4)
As of 2024-04-20 00:29 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found