|We don't bite newbies here... much
Forking Clientsby gepapa (Acolyte)
|on Oct 15, 2008 at 15:30 UTC
gepapa has asked for the wisdom of the Perl Monks concerning the following question:
So I have what I believe is a different question than the norm.
I have a server which has a distinct listener running on multiple ports. What I want to do is be able to make calls to these distinct listeners whenever I want, including simultaneously. So I don't want to necessarily wait on each pid, because I want to be able to do other stuff including making connections to other open listeners. Each call will make the server do something, and I need to get the output back from whatever it is doing.
Here is some sample code I put together to give you a basic idea of what I need to do:
What I need is the information from @resp. I don't care if it is out of order, and I know the print statements I have won't work. I know I need to wait for a particular pid to complete before having data, but what I need is to be able to wait for that pid without blocking the possibility of the other pid's completing before it. So essentially I need the ability to just get the info from whatever call is complete, at any time.
Any help would be greatly appreciated Thanks