> On May 15, 2016, at 5:05 AM, Unknown User <knowsuperunkn...@gmail.com> wrote:
> 
> The port is not in use before i run the script. It is in use when i
> run it. However the problem is that only one iteration runs. I
> expected all to run.

Your ‘listen’ statement is in a loop. Therefore, the second time through the 
loop, the socket will be busy. As Uri suggested, you need to do the listen 
before the loop so you only do it once. Each iteration of the loop should fork, 
and the child branch should connect to the socket created by the parent 
process. The parent branch should do nothing in the loop. At some point, you 
will want to start waiting for the child branches to end and not exit the 
program until they have all completed running.

See ‘perldoc perlipc’ for examples of parent and children processes 
communicating through a socket.


--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/


Reply via email to