#
# Contributed by Bastiaan Bakker for SOCKETMAP
# $Id: socketmapClient.pl,v 1.1 2003-05-21 15:36:33 ca Exp $
use strict;
my $connection = shift @ARGV;
my $sock;
PeerAddr => $1,
PeerPort => $2,
Proto => 'tcp',
);
} elsif ($connection =~ /((unix)|(local)):(.+)/) {
Type => SOCK_STREAM,
Peer => $4
);
} else {
die "unrecognized connection specification $connection";
}
die "Could not create socket: $!\n" unless $sock;
my $request = "$mapname $key";
print "$key => $response\n";
}
$sock->close();
sub netstringWrite {
my $sock = shift;
my $data = shift;
}
sub netstringRead {
my $sock = shift;
my $saveSeparator = $/;
$/ = ':';
my $dataLength = <$sock>;
die "cannot read netstring length" unless defined($dataLength);
chomp $dataLength;
my $data;
} else {
}
$/ = $saveSeparator;
return $data;
}