summaryrefslogtreecommitdiffstats
path: root/abs/mv-core/ghosd/osdClient.pl
diff options
context:
space:
mode:
Diffstat (limited to 'abs/mv-core/ghosd/osdClient.pl')
-rwxr-xr-xabs/mv-core/ghosd/osdClient.pl25
1 files changed, 25 insertions, 0 deletions
diff --git a/abs/mv-core/ghosd/osdClient.pl b/abs/mv-core/ghosd/osdClient.pl
new file mode 100755
index 0000000..06fc381
--- /dev/null
+++ b/abs/mv-core/ghosd/osdClient.pl
@@ -0,0 +1,25 @@
+#!/usr/bin/perl -w
+# osdClient.pl - send simple client text to server
+
+use strict;
+use IO::Socket::INET;
+use POSIX qw(F_GETFL F_SETFL O_NONBLOCK);
+my $sock = "";
+
+if( $#ARGV != 2 ){ die "specify a ip, port, text string" }
+
+eval
+{
+ $sock = IO::Socket::INET->new(
+ PeerAddr => $ARGV[0],
+ PeerPort => $ARGV[1]) || die "can't set it up $!";
+
+ $sock->blocking(0)
+};
+
+if( $@ =~ /socket/i )
+{
+ print "die in record retrieval socket setup with $@";
+}
+
+print $sock "$ARGV[2] \n";