diff --git a/comm-socket.pl b/comm-socket.pl index e9c1b0f3..3748db21 100644 --- a/comm-socket.pl +++ b/comm-socket.pl @@ -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();