|laziness, impatience, and hubris|
TCP socket and forkby adismaug (Acolyte)
|on Jul 04, 2009 at 10:57 UTC||Need Help??|
adismaug has asked for the
wisdom of the Perl Monks concerning the following question:
I am trying to write a script that will open a TCP socket, perform an HTTP get and display the server replay.
The script should fork and all the children should use the same socket (using HTTP version 1.1 and keep alive). The script below works fine but each process open a new socket which adds unnecessary delay (I am using Time::HiRes to calculate the total time to get 10 pages and save the content).
How can I improve the script so all the forked process wil use the same TCP socket?
Your help please…