Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2

Thread: Socket Help

  1. #1
    New Coder
    Join Date
    Jun 2009
    Posts
    10
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Socket Help

    Hi,
    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.

  • #2
    Super Moderator
    Join Date
    May 2005
    Location
    Southern tip of Silicon Valley
    Posts
    2,919
    Thanks
    2
    Thanked 164 Times in 159 Posts
    The best resource book that I know of for this type of task is "Network Programming with Perl" by Lincoln D. Stein
    http://www.amazon.com/Network-Progra.../dp/0201615711

    You'll also want to read the docs for the Socket and IO::Socket modules.
    http://search.cpan.org/~nwclark/perl...cket/Socket.pm
    http://search.cpan.org/~gbarr/IO-1.25/lib/IO/Socket.pm

    For the logging requirment, I'd use Log::Log4perl
    http://search.cpan.org/~mschilli/Log...og/Log4perl.pm


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •