You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
tdenetwork/ksirc/puke/tester.pl

29 lines
576 B

#!/usr/bin/perl
$sock = $ENV{'HOME'} . "/.ksirc.socket";
use Socket;
$proto = getprotobyname('tcp');
socket(fd, PF_UNIX, SOCK_STREAM, 0) || die "Sock failed: $!\n";
$sun = sockaddr_un($sock);
print "Connecting to $sock\n";
connect(fd,$sun) || die "Connect failed: $!\n";
select(fd); $| = 1; select(STDOUT);
while(1){
print "Command: ";
chomp($cmd = <STDIN>);
print "WinId: ";
chomp($winid = <STDIN>);
print "iArg: ";
chomp($iarg = <STDIN>);
print "cArg: ";
chomp($carg = <STDIN>);
$m = pack("iiia50xx", $cmd, $winid, $iarg, $carg);
print fd $m;
}