#!/usr/bin/perl use IO::Socket; # Wichtige Variablen festsetzen my $HOST = shift || "localhost"; my $PORT = "30381"; my $TIMEOUT = "333"; my $socket = new IO::Socket::INET( PeerAddr => $HOST, PeerPort => $PORT, Proto    => 'tcp', # Timeout => $TIMEOUT, ) or die "can't connect to $HOST\n"; # Signalhandler setzen $SIG{'CHLD'} = sub { wait(); };    # Zombies verhindern $SIG{'TERM'} = $SIG{'INT'} = sub { close($socket) }; &handle_connection(); ########################################################## sub handle_connection(){ #handle handshake procedure &send_syn; $msg = <$socket>; if( $msg =~ /c_type=ack\(1\)/ ){ print "[" . localtime() . "] [$HOST] Connection Setup Procedure ACK Paket recieved!\n"; print "now go one"; close($socket); } } #sub handle_connection(){} ##################################################################################### sub send_syn(){ print $socket "c_type=syn(1)\015\12"; return 1; }