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 > Libraries

    Net::Chat::Daemon 0.3

    Download button

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

    License / Price:

    Last Updated:

    Category:
    Steve Fink | More programs
    Perl Artistic License / FREE
    April 5th, 2007, 03:05 GMT
    ROOT / Programming / Libraries

     Read user reviews (0)  Refer to a friend  Subscribe

    Net::Chat::Daemon description

    Net::Chat::Daemon is a Perl module to run a daemon that is controlled via instant messaging.

    Net::Chat::Daemon is a Perl module to run a daemon that is controlled via instant messaging.

    ABSTRACT

    This package is intended to serve as a superclass for objects that want to communicate via IM messages within a distributed network of client nodes and a coordinator, without dealing with the complexities or implementation details of actually getting the messages from place to place.

    It pretends to be protocol-neutral, but for now and the conceivable future will only work with a Jabber transport. (It directly uses the message objects and things that Jabber returns.)

    Note that this package will NOT help you implement an instant messaging server. This package is for writing servers that communicate with other entities via instant messages -- servers written using this package are instant messaging *clients*.

    SYNOPSIS

    package My::Server;
    use base 'Net::Chat::Daemon';
    sub handleHello {
    return "hello to you too";
    }
    sub handleSave {
    my ($filename, $file) = @_;
    return "denied" unless $filename =~ /^[.w]+$/;
    open(my $fh, ">/var/repository/$filename") or return "failed: $!";
    print $fh $file;
    close $fh or return "failed: $!";
    return "ok";
    }
    sub someMethod {
    my ($self, @args) = @_;
    .
    .
    .
    }
    sub new {
    my ($class, $user, %options) = @_;
    return $class->SUPER::new(%options,
    commands => { 'callMethod' => 'someMethod',
    'save' => &handleSave });
    }

    package main;
    my $server = My::Server->new('myuserid@jabber.org');
    $server->process();

    # or to do it all in one step, and retry connections for 5 minutes
    # (300 seconds) before failing due to problems reaching the server:

    My::Server->run('myuserid@jabber.org', retry => 300);

    When you run this, you should be able to send a message to userid@jabber.org saying "hello" and get a response back, or "callMethod a b c" to call the method with the given arguments.

    To use the "save" command, you'll need to use a command-line client capable of sending attachments in the format expected by this server (it currently does not use any standard file-sending formats).

    The jabber command packaged with this module can do this via the -a command-line option.

    A note on the implementation: when I first wrote this, it was really only intended to be used with Jabber. The code hasn't been fully restructured to remove this assumption.

    Requirements:

    · Perl



    Product's homepage

    Requirements:

    · Perl

      


    TAGS:

    instant messaging | Perl daemon | Perl module | Net::Chat::Daemon | instant | messaging

    Go to top

    WindowsGamesDriversMacLinuxScriptsMobileHandheldNews

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