Re: maximum outgoing connections



problem is solved, it was just a server issue...


replay wrote:
hi list

im trying to write a script to test an irc server for his maxincoming connections...

so i wrote a script which connects many times to it. but it is only able to open 3 connections, every more connection is just like empty!?!?

i don`t know if there is maybe a limit by the kernel or something, but 3 connections is not very much:-)

thanks for help


##################################################################################




#!/usr/bin/perl -w

use strict;
use IO::Socket;

my $connection_count = 5;
my $botnick_pre = "testbot";

my $botnick_tempnum = 0;
my $botnick_tempnick;
my $fork_return;

while ($botnick_tempnum < $connection_count)
{
   $botnick_tempnick = $botnick_pre . $botnick_tempnum;

   if (!fork)
   {
      &one_fork($botnick_tempnick);
   }
   sleep 1;
   $botnick_tempnum++;
}
exit;

sub one_fork {
   my $server = "195.186.3.186";
   my $nick = $_[0];
   my $pong;
   my $input;
   my $channel = "#linux";
   my $sock = new IO::Socket::INET(PeerAddr => $server,
                                   PeerPort => 6667,
                                   Proto => 'tcp') or
                                      die "Can't connect\n";
   if (!defined($sock))
   {
      print "\nexit cause sock isnt defined\n";
      exit;
   }
   print $sock "NICK " . $nick . "\r\n";
   print $sock "USER bot 1 1 :Test Bot\r\n";
   while ($input = <$sock>) {
      if ($input =~ /004/) {
         print "logged in with $nick\n";
      }
      elsif ($input =~ /433/) {
         die "Nickname is already in use.";
      }
      if ($input =~ /^PING(.*)$/i) {
         $pong = "PONG$1\r\n";
         print $sock $pong;
      }
      sleep 1;
   }
   print $nick . " died\n";
   exit;
}



##################################################################################







--

visit: http://www.h4xx0r.ch
.



Relevant Pages

  • maximum outgoing connections
    ... im trying to write a script to test an irc server for his maxincoming connections... ... print "\nexit cause sock isnt defined\n"; ...
    (perl.beginners)
  • Re: Changing a users password non-interactively?
    ... You need expect and a setpass.expect script which ill add ... exit with a nasty warning. ... # Be careful of the COMMAND and UNDOCMD - they are dependant on your ...
    (comp.unix.aix)
  • Re: script does not always work the same each time.
    ... I have written a simple script to test code build and test run on a ... $lineterminationChar {append output $expect_out; ... exit 1;} ...
    (comp.lang.tcl)
  • Re: need small PHP job done
    ... i need help tweaking a PHP mail script; ... // check for a recipient email address and check the validity of it ... // check for an attachment if there is a file upload it ...
    (alt.php)
  • Re: OSR505 Signal trapping in shell scripts
    ... >>My test script is at the end. ... > process only gets one SIGHUP per fd. ... > end up doing ioctls on fd 0, which is your stopio'd telnetd pty. ... > of the exit function. ...
    (comp.unix.sco.misc)