Hello world/Web server: Difference between revisions
Content added Content deleted
(removed the last change --- it failed to listen to :8080 (it did a listen to :5000)) |
(Perl: simplify IO::Socket::INET call by using LocalAddr and remove Proto ("tcp" is default anyway)) |
||
Line 668: | Line 668: | ||
<lang Perl>use IO::Socket::INET; |
<lang Perl>use IO::Socket::INET; |
||
my $sock = new IO::Socket::INET ( |
my $sock = new IO::Socket::INET ( LocalAddr => "127.0.0.1:8080", |
||
LocalPort => "8080", |
|||
Proto => "tcp", |
|||
Listen => 1, |
Listen => 1, |
||
Reuse => 1, ) or die "Could not create socket: $!"; |
Reuse => 1, ) or die "Could not create socket: $!"; |