in reply to Re^8: A non-blocking server using 'select' calls
in thread A non-blocking server using 'select' calls
Perhaps it is your shell. With a telnet client on windows to a remote Linux server this is a teletype when watched via putty. Maybe it is a BSD issue?
[root@devel3 james.freeman]# cat test.pl #!/usr/bin/perl use IO::Socket; use IO::Select; my $lsn = IO::Socket::INET->new( Listen => 10, LocalAddr => '64.246.xx.xx', LocalPort => 9000 ); my $client = new IO::Select( $lsn ); while( my @ready = $client->can_read ) { for my $fh (@ready) { if($fh == $lsn) { warn "Accepted new socket\n"; my $new = $lsn->accept; $client->add($new); } else { syswrite(STDOUT,$_,1) if sysread($fh,$_,1 ); } } }
cheers
tachyon
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^10: A non-blocking server using 'select' calls
by nikos (Scribe) on Nov 11, 2004 at 12:34 UTC |