TCP/IP Implementation: Passive Open example

When we tried to run the sample program found in the manual Example of Passive Open we had an error message. It is a simple program and a sample provided–it should be fairly easy to make this work. Any ideas on what we are forgetting? The code is attached.

Error message:
Connecting to…Could not open a connection to host on port 7: Connect failed