Networking HC
Volume Number: 5
Issue Number: 12
Column Tag: HyperChat™
A Look Into Networking 
By Donald Koscheka, Ernst & Young, MacTutor Contributing Editor
Note: Source code files accompanying article are located on MacTech CD-ROM orsource code disks.
Programming the Network
Network programming is fun. Over the past year, I’ve presented a suite of
XCMDs that provide the Hypercard developer with network access. Rather than
present a new XCMD this month, I thought it might be interesting to revisit some of the
xcmds that we developed during the year. If you don’t have access to back issues of
Mactutor, you can obtain the source code for these xcmds from this magazine.
Programming the network is not unlike programming in Hypertalk. In both
instances, you are concerned with the behavior of distributed processes. In
HyperTalk, processes are distributed over several card and background objects. On the
network, objects are distributed over time.
Time distribution of processes adds a new wrinkle to the programming task: how
do you know when a given process has completed? The problem stems from the fact
that we operate the network asynchronously; when we issue a request for some
network service, we don’t wait around for an answer. Rather, we return to
Hypercard, leaving the network to handle the request in its own good time.
Figure 1 depicts a card for a prototypical network application called
Hyperserver. The card contains two icons, each of which provides some access to the
network. Clicking on the volumes icon will cause the card to display a list of available
servers. Selecting one of these servers will immediately send a message to the selected
server requesting a list of its mounted volumes. Similarly, the catalog icon will
return a catalog of the current folder on the server (for now, I leave it to your
imagination to determine what other things one can do with such a card).
Figure 1. A prototypical screen for HyperServer
The process of sending a message to a server requires that you first call the call
the server. Next you send a “get volumes” message to the server. Then you must wait
for a response from the server. Once the server responds, you hangup).