#!/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";