programming-examples/perl/Network/sockaddr_un($file).pl

13 lines
259 B
Perl
Raw Normal View History

2019-11-15 12:59:38 +01:00
use Socket;
$file = 'transfer';
socket(SOCKET, PF_UNIX, SOCK_STREAM, 0) or die "Could not create socket.\n";
connect(SOCKET, sockaddr_un($file)) or die "Could not connect.\n";
print SOCKET "Hello from the client!\n";
close SOCKET;
exit;