in reply to Net::IRC, load testing, and threads

I my self run an IRC server and remember trying to run such
a test with Net::IRC. If I remember correctly it doesnt
allow you to have more than one Net::IRC handle. But you
be able to do so by editing the module. I would suggest
writing a Socket based tester or not even bother, If your using
an ircd that is used by one of the big networks then you shouldn't
have to bother



lindex
/****************************/ jason@gost.net, wh@ckz.org http://jason.gost.net /*****************************/

Replies are listed 'Best First'.
RE: Re: Net::IRC
by ferrency (Deacon) on Jul 21, 2000 at 07:34 UTC
    Actually, you can run more than one connection with Net::IRC. Here is a minimal demonstration script:

    #!/usr/bin/perl use Net::IRC; use strict; my $server = "myserver"; my $irc = new Net::IRC; my $conn1 = $irc->newconn(Nick => "test1", Server => $server, Port => 6667); my $conn2 = $irc->newconn(Nick => "test2", Server => $server, Port => 6667); $conn1->add_global_handler('msg', \&on_msg); $conn2->add_global_handler('msg', \&on_msg); $irc->start; sub on_msg { my ($self, $event) = @_; my $who = $event->nick; $self->privmsg($who, "hello, $who!!"); }
    Send a message to either of the bots, and they'll reply. You can also add different handlers for each connection, and it'll do the right thing.

    However, I don't know if this gets you a win or a lose as to open file handles overall...

    Alan

      Iam humbled yet agian :) get my vote.


      lindex
      /****************************/ jason@gost.net, wh@ckz.org http://jason.gost.net /*****************************/