View Full Version : Socket Help

ACS - Nick
08-05-2009, 03:03 PM
I have a bit of a tough one for me.
I have a server which I give a word to (say 'Chanel1').
It responds with whether the chanel is currently siezed and some other stats.
Depending on this responce I need to fire off a script.
There are some limits like the amount of times you can check for the chanel to be free (5 checks per second total).
Other things I would like to implement is some kind of restart script so if it dies before it gets the chanel free it will restart the checking. And logging if possible.
Another part is sometimes I need to check multiple chanels and as each one becomes available run the script on it.

I think I need to use Sockets to achieve this?
What Im after is any good reading on this and other bits of the puzzle I would need? Im not looking for someone to write the code.
I do have experiance in PHP butI am new to Perl so any help on where to look/start would be great.

08-05-2009, 03:25 PM
The best resource book that I know of for this type of task is "Network Programming with Perl" by Lincoln D. Stein

You'll also want to read the docs for the Socket and IO::Socket modules.

For the logging requirment, I'd use Log::Log4perl