Beefy Boxes and Bandwidth Generously Provided by pair Networks Ovid
go ahead... be a heretic
 
PerlMonks  

Re: Activeperl 5.6 fork() doesn't friggin work

by Corion (Patriarch)
on Apr 18, 2002 at 03:04 UTC ( [id://160126]=note: print w/replies, xml ) Need Help??

This is an archived low-energy page for bots and other anonmyous visitors. Please sign up if you are a human and want to interact.


in reply to Activeperl 5.6 fork() doesn't friggin work

I'd say that fork() does work sometimes under ActiveState Perl, but the problems start as soon as you share too much stuff (like, for example, sockets) between the two processes.

There are some ways around your specific problem, for example, you could use a perlfunc:select-based client that checks whether there is something to read or write. I've done so with a server here, but the concept can be reused for a client as well.

As for another route, if you have control over the server as well, you might want to change your protocol to HTTP or some other protocol that sends the size of the response within the response header.

perl -MHTTP::Daemon -MHTTP::Response -MLWP::Simple -e ' ; # The $d = new HTTP::Daemon and fork and getprint $d->url and exit;#spider ($c = $d->accept())->get_request(); $c->send_response( new #in the HTTP::Response(200,$_,$_,qq(Just another Perl hacker\n))); ' # web

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://160126]
help
Sections?
Information?
Find Nodes?
Leftovers?
    Notices?
    hippoepoptai's answer Re: how do I set a cookie and redirect was blessed by hippo!
    erzuuliAnonymous Monks are no longer allowed to use Super Search, due to an excessive use of this resource by robots.