Client

URL Loading System Guide

Source code in Client.zip

  1. main.m
  2. Class ClientAppDelegate
  3. Class View

The server on i5.nyu.edu

The server is the CGI gateway /home1/m/mm64/public_html/cgi-bin/imageserver written in the language Perl. You can run the server by clicking here. Run it several times.

#!/bin/perl

$n = 3;
$r = int(rand($n));	#a random integer

if ($r % $n == 0) {
        print "Content-type: image/png\n\n";
        $filename = '/home1/m/mm64/public_html/INFO1-CE9236/src/client/spj224.png';
} elsif ($r % $n == 1) {
        print "Content-type: image/png\n\n";
        $filename = '/home1/m/mm64/public_html/INFO1-CE9236/src/client/bb1335.png';
} else {
        print "Content-type: image/gif\n\n";
        $filename = '/home1/m/mm64/public_html/markface.gif';
}

open(IMAGEFILE, $filename) or die "$0: $!";
print <IMAGEFILE>;
close(IMAGEFILE);
exit 0;