in reply to Could not create socket: Bad file number
The results were:#!/usr/bin/perl -w use IO::Socket; print "Receiver...\n"; my $sock = new IO::Socket::INET ( LocalHost => 'localhost', LocalPort => 7070, Proto => 'tcp', Listen => 1, Reuse => 1, ); die "Could not create socket: $!\n" unless $sock; my $new_sock = $sock->accept(); while(<$new_sock>) { print $_; } close($sock);
C:\Code>perl socket.pl Receiver... Testing This is a test by telnetting to port 7070 C:\Code>
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Could not create socket: Bad file number
by ikegami (Patriarch) on Aug 30, 2007 at 21:13 UTC | |
by Joost (Canon) on Aug 30, 2007 at 21:18 UTC | |
by perlofwisdom (Pilgrim) on Aug 30, 2007 at 21:45 UTC | |
|
Re^2: Could not create socket: Bad file number
by perlofwisdom (Pilgrim) on Aug 30, 2007 at 21:08 UTC | |
by bruceb3 (Pilgrim) on Aug 30, 2007 at 23:15 UTC |