#!/usr/bin/perl

use IO::Handle;
use IO::Socket;
#use strict;

# suche im phex: "Suchbegriff .Dateityp"

my $socket = IO::Socket::INET->new(PeerAddr => "localhost",
                                PeerPort	=> ###########,
                                Proto		=> "tcp",
								Timeout		=> 3,
                                Type		=> SOCK_STREAM)
    or die "Couldn't connect to host $@\n";
binmode($socket);
$socket->autoflush(1);

# zuerst das "Hi" vom server abholen
# my $t = <$socket>;
#print "$t\n";

# result rausholen 
my $t = <$socket>;

$Rstring = "result 69 abc";
syswrite($socket, $Rstring , length($Rstring) );	
print $socket "\r\n";
my $tt = <$socket>;

open(WH,">dump.txt");
print WH $tt;
close WH;

print $tt;


close $socket;
exit;