6
CONTENTS
11 Examples of P2P Programming
127
11.1 Servents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 127
11.2 Network aware GUI components . . . . . . . . . . . . . . . . . . 127
11.3 Running a chat registrar . . . . . . . . . . . . . . . . . . . . . . . 127
11.4 Whiteboards . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 127
11.5 Shared Textareas . . . . . . . . . . . . . . . . . . . . . . . . . . . 127
V
Appendices
129
A The Tomcat server and Jscheme
131
A.1 Installation instructions for Mac/Linux . . . . . . . . . . . . . . . 131
A.1.1 Installing tomcat . . . . . . . . . . . . . . . . . . . . . . . 131
A.1.2 Starting/Stopping the Tomcat Server . . . . . . . . . . . 131
A.1.3 Adding content to the server . . . . . . . . . . . . . . . . 132
A.1.4 Accessing the server . . . . . . . . . . . . . . . . . . . . . 132
A.2 Installation instructions for the PC . . . . . . . . . . . . . . . . . 133
A.2.1 Installing tomcat . . . . . . . . . . . . . . . . . . . . . . . 133
A.2.2 Starting/Stopping the Tomcat Server . . . . . . . . . . . 133
A.2.3 Adding content to the server . . . . . . . . . . . . . . . . 134
A.2.4 Accessing the server . . . . . . . . . . . . . . . . . . . . . 134
A.3 Creating a certificate for secure web pages . . . . . . . . . . . . . 134
A.4
Configuring for email . . . . . . . . . . . . . . . . . . . . . . . . 134
B Installing the HSQL Database
135
C The Scheme Dialect Used in this Text
137
C.1 Core grammar of Scheme programs . . . . . . . . . . . . . . . . . 137
C.1.1 Math Primitives . . . . . . . . . . . . . . . . . . . . . . . 138
C.1.2 Special Forms . . . . . . . . . . . . . . . . . . . . . . . . . 138
Definitions . . . . . . . . . . . . . . . . . . . . . . . . . . 138
Anonymous functions . . . . . . . . . . . . . . . . . . . . 139
Changing defined values . . . . . . . . . . . . . . . . . . . 139
Conditional Execution . . . . . . . . . . . . . . . . . . . . 139
C.1.3 Grouping for side effects . . . . . . . . . . . . . . . . . . . 140
C.1.4 Local Variable Binding . . . . . . . . . . . . . . . . . . . . 141
C.1.5 Exception Handling . . . . . . . . . . . . . . . . . . . . . 141
D Code for the servlet and applet libraries
143
D.1 Files.scm . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 144
D.2 mail.scm . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 145