Softpedia
 


LINUX CATEGORIES:



GLOBAL PAGES >>
NEWS ARCHIVE >>
SOFTPEDIA REVIEWS >>
MEET THE EDITORS >>
WEEK'S BEST
  • Linux Kernel 3.9.3 / 3....
  • LibreOffice 3.6.6 / 4.0.3
  • MPlayer 1.1.1
  • systemd 204
  • Arch Linux 2013.05.01
  • Blender 2.67a
  • KDE Software Compilatio...
  • CrunchBang Linux Stable...
  • Elementary OS 0.1 / 0.2...
  • SystemRescueCd 3.6.0
  • Home > Linux > Programming > Perl Modules

    IO::Socket::INET::Daemon 0.04

    Download button

    No screenshots available
    Downloads: 1,054  View global page NEW!  Tell us about an update
    User Rating:
    Rated by:
    Good (3.2/5)
    7 user(s)
    Developer:

    License / Price:

    Last Updated:

    Category:
    Jonas Kramer | More programs
    Perl Artistic License / FREE
    May 29th, 2008, 13:40 GMT
    ROOT / Programming / Perl Modules

     Read user reviews (0)  Refer to a friend  Subscribe

    IO::Socket::INET::Daemon description

    IO::Socket::INET::Daemon is a very simple and straightforward TCP server.

    IO::Socket::INET::Daemon is a very simple and straightforward TCP server.

    SYNOPSIS

    use IO::Socket::INET::Daemon;

    my $host = new IO::Socket::INET::Daemon(
    port => 5000,
    timeout => 20,
    callback => {
    add => &add,
    remove => &remove,
    data => &data,
    },
    );

    $host->run;

    sub add {
    my $io = shift;

    $io->print("Welcome, ", $io->peerhost, ".n");

    return !0;
    }

    sub remove {
    my $io = shift;

    warn $io->peerhost, " left.n";
    }

    sub data {
    my ($io, $host) = @_;

    my $line = $io->getline;

    $line =~ s/r?n//;

    if($line eq 'quit') {
    $io->print("Bye.n");
    return 0;
    }
    elsif($line eq 'stop') {
    $host->stop;
    }
    else {
    $io->print("You wrote: $linen");
    return !0;
    }
    }

    This modules aims to provide a simple TCP server. It will listen on a port you specify, accept incoming connections and remove them again when they're dead. It provides three simple callbacks at the moment, but I plan to add a few more.

    Product's homepage

    Requirements:

    · Perl

      


    TAGS:

    TCP server | INET daemon | Perl module | TCP | server | INET

    Go to top

    WindowsGamesDriversMacLinuxScriptsMobileHandheldNews

    SUBMIT PROGRAM   |   ADVERTISE   |   GET HELP   |   SEND US FEEDBACK   |   RSS FEEDS   |   UPDATE YOUR SOFTWARE   |   ROMANIAN FORUM