Re: maximum outgoing connections
- From: replay <mauro.stettler@xxxxxxxxx>
- Date: Fri, 16 Dec 2005 09:33:54 +0100
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 .
- References:
- maximum outgoing connections
- From: replay
- maximum outgoing connections
- Prev by Date: Re: split regex
- Next by Date: copy using perl on windows
- Previous by thread: maximum outgoing connections
- Next by thread: How do you determine if a file is a symlink?
- Index(es):
Relevant Pages
|