Simple test script which sends a single authority record over the
network for testing marc_stream_importer.pl.
Signed-off-by: Bill Erickson <berickxx@gmail.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
--- /dev/null
+#!/usr/bin/perl
+use strict;
+use warnings;
+use IO::Socket::INET;
+
+# simple test to send an authority record to marc_stream_importer.pl
+
+my $marc = '00208nz a2200097o 45 0001001400000003000500014005001700019008004100036040001500077100001800092\1eIISGa11554924\1eIISG\1e20021207110052.0\1e021207n| acannaabn |n aac d\1e \1faIISG\1fcIISG\1e0 \1faMaloy, Eileen\1e\1d';
+
+my $socket = IO::Socket::INET->new(
+ PeerAddr => 'localhost',
+ PeerPort => 5544,
+ Proto => 'tcp'
+) or die "socket failure $!\n";
+
+$socket->print($marc) or die "socket print failure: $!\n";
+
+while (chomp(my $line = $socket->getline)) {
+ print "Read: $line\n";
+}
+