programming-examples/perl/Network/Socket Server.pl

19 lines
297 B
Perl
Raw Normal View History

2019-11-15 12:59:38 +01:00
use IO::Socket;
$server = IO::Socket::INET->new
(
LocalPort => 1116,
Type => SOCK_STREAM,
Reuse => 1,
Listen => 5
) or die "Could not open port.\n";
while ($client = $server->accept()) {
$line = <$client>;
print $line;
}
close($server);