Can use comm-socket with argument

This commit is contained in:
nemunaire 2014-01-20 10:58:59 +01:00
parent 147bb5be55
commit 5b2b4265a4
1 changed files with 12 additions and 2 deletions

View File

@ -7,12 +7,22 @@ use threads;
die("Give at least the socket file as argument") if (! @ARGV);
my $sock_path = shift @ARGV;
my $socket = IO::Socket::UNIX->new(
Type => SOCK_STREAM,
Peer => $ARGV[0],
Peer => $sock_path,
);
die "Can't create socket: $!" unless $socket;
die "Can't read socket ($sock_path): $!" unless $socket;
if (@ARGV)
{
while (my $arg = shift @ARGV)
{
say $socket $arg;
}
}
my $s = IO::Select->new();