#!/usr/bin/perl
# ftp active mode data server (runs on the ftp client side)
# Peter Walsh csci 460

use IO::Socket;
$sock = new IO::Socket::INET (
                                 LocalHost => 'cscicad.mala.bc.ca',
                                 LocalPort => '50069',
                                 Proto => 'tcp',
                                 Listen => 1,
                                 Reuse => 1,
                                 );
die "Could not create socket: $!\n" unless $sock;

$new_sock = $sock->accept();
while (<$new_sock>) {
   print "In read loop \n";
   print $_;
}
close($sock);

