semio has asked for the wisdom of the Perl Monks concerning the following question:
This resulted in killing the application listening to this port and the processor utilization shot to 100%. I'm interested in knowing if there is a better way to stress test network applications with Perl and, in particular, the experiences of other monks when working on a problem such as this. I will also be notifying the vendor but I want to spend a few more days looking at this.#!d:/perl/bin/perl -w use strict; use Socket; my $line = "A" x 1000; my ($iaddr, $sin, $proto); my $max = 2000; my $port = <suspect port here>; while (1) { $proto = getprotobyname('tcp'); socket(SOCK, PF_INET, SOCK_STREAM, $proto); $iaddr = gethostbyname('IP address of device'); $sin = sockaddr_in($port, $iaddr); connect(SOCK, $sin); send(SOCK,$line,0,$iaddr); }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: application stress testing with Perl
by sauoq (Abbot) on Sep 24, 2002 at 00:27 UTC | |
by Ryszard (Priest) on Sep 24, 2002 at 07:59 UTC |