summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJesse Luehrs <doy@tozt.net>2010-03-27 21:16:45 -0500
committerJesse Luehrs <doy@tozt.net>2010-03-27 21:16:45 -0500
commit99672ca05fc56ae74979f0f065f40abe34d73504 (patch)
treec61827c79f79980f0432a4d16257547e24267c24
parent376a2274ddcf20d61d1f4f5fcdd07e0b8b8e9be2 (diff)
downloadapp-termcast-99672ca05fc56ae74979f0f065f40abe34d73504.tar.gz
app-termcast-99672ca05fc56ae74979f0f065f40abe34d73504.zip
error checking
-rw-r--r--lib/App/Termcast.pm2
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/App/Termcast.pm b/lib/App/Termcast.pm
index f99ecc4..fb01c6a 100644
--- a/lib/App/Termcast.pm
+++ b/lib/App/Termcast.pm
@@ -78,6 +78,8 @@ sub connect {
my $self = shift;
my $socket = IO::Socket::INET->new(PeerAddr => $self->host,
PeerPort => $self->port);
+ die "Couldn't connect to " . $self->host . ": $!"
+ unless $socket;
$socket->write('hello '.$self->user.' '.$self->password."\n");
return $socket;
}