Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Make eval client die on connect failure.
  • Loading branch information
donaldh committed Jun 17, 2014
1 parent 9bb18da commit a5894d2
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion tools/jvm/eval-client.pl
Expand Up @@ -27,7 +27,8 @@ sub read_file {
my $info = scalar read_file shift @ARGV;
my ($port, $cookie) = $info =~ /(\d+) (\S+)$/m or die "cannot parse cookie file";

my $sock = IO::Socket::INET->new( PeerAddr => '127.0.0.1', PeerPort => $port, Proto => 'tcp' );
my $sock = IO::Socket::INET->new( PeerAddr => '127.0.0.1', PeerPort => $port, Proto => 'tcp' )
or die "cannot connect to eval server: $!\n";

$sock->syswrite( Encode::encode_utf8(join("\0", $cookie, @ARGV, "")) ) or die "syswrite: $!\n";
$sock->shutdown(1) or die "shutdown: $!\n"; # perldoc -f shutdown
Expand Down

0 comments on commit a5894d2

Please sign in to comment.