19 lines
297 B
Perl
19 lines
297 B
Perl
|
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);
|